I’m compiling ResNet50 model for Raspberry Pi3 (armv7l) on x86 box and I’d like to export model library to “so” file instead of “tar” file.
If I just change file extension from “tar” to “so” then I got linker (/usr/bin/ld
) error
path_lib = "model.so"
lib.export_library(path_lib)
Error:
# ./compile.py
('model:', 'resnet50_v2', ', target:', llvm -device=arm_cpu -model=bcm2837 -target=armv7l-linux-gnueabihf -mattr=+neon, ', target_host:', None, ', opt_level:', 3, ', data_shape:', (1, 3, 224, 224))
Compiling...
No handlers could be found for logger "autotvm"
Compilation done
Saving files
Traceback (most recent call last):
File "./compile.py", line 49, in <module>
lib.export_library(path_lib)
File "/root/tvm/python/tvm/module.py", line 121, in export_library
fcompile(file_name, files, **kwargs)
File "/root/tvm/python/tvm/contrib/cc.py", line 33, in create_shared
_linux_shared(output, objects, options, cc)
File "/root/tvm/python/tvm/contrib/cc.py", line 58, in _linux_shared
raise RuntimeError(msg)
RuntimeError: Compilation error:
/usr/bin/ld: /tmp/tmpmj3yXZ/lib.o: Relocations in generic ELF (EM: 40)
/usr/bin/ld: /tmp/tmpmj3yXZ/lib.o: Relocations in generic ELF (EM: 40)
/tmp/tmpmj3yXZ/lib.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
I do have /usr/arm-linux-gnueabi
installed on x86 box. Is there a way to ask tvm compiler to use lib
, include
and bin
from /usr/arm-linux-gnueabi
to export model lib to “so” file?