使用 https://github.com/NVIDIA/DIGITS/blob/digits-5.0/docs/BuildDigits.md 指南安装DIGITS时,
运行 ./digits-devserver 出现下面的错误
File "/home/app/caffe-master/python/caffe/proto/caffe_pb2.py", line 831, in <module>
options=_descriptor._ParseOptions(descriptor_pb2.FieldOptions(), _b('\020\001')), file=DESCRIPTOR),
TypeError: __new__() got an unexpected keyword argument 'file'
TypeError: __new__() got an unexpected keyword argument 'file'
在python下 import caffe 和 tensorflow时出现与上述类似的错误。
后来发现 DIGITS下的安装说明文件 requirements.txt中有指定 protobuf版本为:protobuf>=2.5.0,<=3.2.0
原系统中anaconda 下的 protobuf版本为 3.5.2
运行完 pip install -r requirements.txt 之后,protonbuf版本将为 3.2.0,导致 pycaffe、tensorflow以及digits均无法使用。
解决方法:pip uninstall protobuf
pip install protobuf==3.5.2 还原protobuf版本
问题解决。
pycaffe、tensorflow恢复正常,digits启动成功。