1.ImportError: No module named skimage.io
>>> import caffe
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
File “caffe/__init__.py”, line 1, in <module>
from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver, NCCL, Timer
File “caffe/pycaffe.py”, line 15, in <module>
import caffe.io
File “caffe/io.py”, line 2, in <module>
import skimage.io
ImportError: No module named skimage.io
Solution:
Lack of skimage toolbox
pip install scikit-image
2.ImportError: dynamic module does not define module export function (PyInit__caffe)
>>> import caffe
Traceback (most recent call last):
File “<stdin>”, line 1, in <module>
File “/home/wangxiao/Downloads/project/caffe-master/python/caffe/__init__.py”, line 1, in <module>
from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver
File “/home/wangxiao/Downloads/project/caffe-master/python/caffe/pycaffe.py”, line 13, in <module>
from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, \
ImportError: dynamic module does not define module export function (PyInit__caffe)
>>>
I found that Python 3.5 is the cause, because higher versions of Python and caffe are not necessarily compatible.
The official caffe website (http://caffe.berkeleyvision.org/) also suggests that caffe 2.7 is only better supported; for other versions, you need to figure it out yourself.
3.ImportError: No module named google.protobuf.internal
Solution:
sudo pip install protobuf
4.ImportError: No module named caffe
Solution: Add the python directory under the caffe directory to the environment variables
exportPYTHONPATH=/work/project/caffe/python:$PYTHONPATH
Similar Posts:
- Caffe installation and compilation problems – importerror: no module named skimage.io
- Caffe Install ImportError: No module named google.protobuf.internal
- ImportError: No module named caffe.proto [How to Solve]
- [Solved] rosrun import rospy Error: ImportError: No module named yaml
- caffe2——–ImportError: No module named past.builtins
- Symbol not found: __PyCodecInfo_GetIncrementalDecoder
- [Solved] xadmin Error: ImportError: cannot import name ‘DEFAULT_FORMATS’ from ‘import_export.admin’ (/home/lijun/app/hippo/hippo_api/venv/lib/python3.8/site-packages/import_export/admin.py)
- How to Solve Centos Yum Error: No module named yum
- Python for mac or windows: ModuleNotFoundError: No module named ‘lxml’ [How to Solve]
- docker:ImportError: libcuda.so.1: cannot open shared object file: No such file or directory