1、ImportError: No module named skimage.io
import caffe
Traceback (most recent call last):
File “
解决方案:
缺乏skimage工具箱
pip install scikit-image
2、ImportError: dynamic module does not define module export function (PyInit__caffe)
import caffe
Traceback (most recent call last):
File ”
File “/home/wangxiao/Downloads/project/caffe-master/python/caffe/init.py”, line 1, in
from .pycaffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, RMSPropSolver, AdaDeltaSolver, AdamSolver
File “/home/wangxiao/Downloads/project/caffe-master/python/caffe/pycaffe.py”, line 13, in
from ._caffe import Net, SGDSolver, NesterovSolver, AdaGradSolver, \
ImportError: dynamic module does not define module export function (PyInit__caffe)
发现是 Python 3.5 导致的,因为版本较高的 Python 和 caffe 不一定兼容;
caffe 官网 (http://caffe.berkeleyvision.org/) 上也提示说, 只是较好的支持 caffe 2.7 版本;对于其他的版本,需要自己进行摸索咯。
3、ImportError: No module named google.protobuf.internal
解决方案:
sudo pip install protobuf
4、ImportError: No module named caffe
解决方案:把caffe目录下的python目录,添加到环境变量中
export PYTHONPATH=/work/project/caffe/python:$PYTHONPATH
Original: https://www.cnblogs.com/alan666/p/8311832.html
Author: 隔壁王叔叔a
Title: python命令行中import caffe报错的解决方案
原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/15751/
转载文章受原作者版权保护。转载请注明原作者出处!