caffe icon indicating copy to clipboard operation
caffe copied to clipboard

IMPORT ERROR

Open DongStop opened this issue 2 years ago • 9 comments

Traceback (most recent call last): File "demo.py", line 6, in import caffe
File "/home/dong/work/caffe/python/caffe/init.py", line 1, in from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer File "/home/dong/work/caffe/python/caffe/pycaffe.py", line 13, in from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver,
ImportError: /home/dong/work/caffe/build/lib/libcaffe.so.1.0.0: unexpected reloc type 0x03

DongStop avatar Mar 02 '22 09:03 DongStop

这是来自QQ邮箱的假期自动回复邮件。 谢谢,您的邮件已收到,尽快给您回复。

xiaolin1990 avatar Mar 02 '22 09:03 xiaolin1990

您好,邮件已收到,谢谢!

lovie123 avatar Mar 02 '22 09:03 lovie123

这是来自QQ邮箱的假期自动回复邮件。   您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。

dragonQian avatar Mar 02 '22 10:03 dragonQian

Traceback (most recent call last): File "demo.py", line 6, in import caffe File "/home/dong/work/caffe/python/caffe/init.py", line 1, in from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer File "/home/dong/work/caffe/python/caffe/pycaffe.py", line 13, in from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, ImportError: /home/dong/work/caffe/build/lib/libcaffe.so.1.0.0: unexpected reloc type 0x03

@DongStop The reason for this problem is that the relevant dependencies are missing in your python compilation environment. You only need to download the relevant dependencies through pip or conda just like: pip install <source-package> conda install <source-package>

Rocksnake avatar Mar 03 '22 08:03 Rocksnake

@Rocksnake But I dont't know what dependencies are missing.the compiling process is successful.

DongStop avatar Mar 04 '22 03:03 DongStop

@Rocksnake the cmake information as follow ******************* Caffe Configuration Summary ******************* General: Version : 1.0.0 Git : 1.0-136-g9b891540-dirty System : Linux C++ compiler : /usr/bin/c++ Release CXX flags : -O3 -DNDEBUG -fPIC -Wall -Wno-sign-compare -Wno-uninitialized Debug CXX flags : -g -fPIC -Wall -Wno-sign-compare -Wno-uninitialized Build type : Release BUILD_SHARED_LIBS : ON BUILD_python : ON BUILD_matlab : OFF BUILD_docs : ON CPU_ONLY : ON USE_OPENCV : ON USE_LEVELDB : ON USE_LMDB : ON USE_NCCL : OFF ALLOW_LMDB_NOLOCK : OFF USE_HDF5 : ON Dependencies: BLAS : Yes (Atlas) Boost : Yes (ver. 1.78) glog : Yes gflags : Yes protobuf : Yes (ver. ..) lmdb : Yes (ver. 0.9.24) LevelDB : Yes (ver. 1.22) Snappy : Yes (ver. 1.1.8) OpenCV : Yes (ver. 3.4.16) CUDA : No Python: Interpreter : /usr/bin/python (ver. 3.7.1) Libraries : /usr/local/lib/libpython3.7m.a (ver 3.7.1) NumPy : /usr/local/lib/python3.7/site-packages/numpy/core/include (ver 1.21.5)

Documentaion: Doxygen : No config_file :
Install: Install path : /home/dong/work/caffe/build/install Configuring done Generating done Build files have been written to: /home/dong/work/caffe/build

DongStop avatar Mar 04 '22 03:03 DongStop

The package after the from keyword is a large package, and the package after the import keyword is included in the former. You can choose to download the package after the from keyword, or you can choose to download the package after the import. I think you just need to execute these code: pip install caffe pip install .pycaffe pip install ._caffe

Rocksnake avatar Mar 04 '22 03:03 Rocksnake

@Rocksnake my hardware doesn't support GPU.maybe using pip to install doesn't make it work!

DongStop avatar Mar 04 '22 03:03 DongStop

image

DongStop avatar Mar 04 '22 04:03 DongStop