当前位置: 代码迷 >> 综合 >> caffe2导入时出现“TypeError: __new__() got an unexpected keyword argument 'file'”[Solved]
  详细解决方案

caffe2导入时出现“TypeError: __new__() got an unexpected keyword argument 'file'”[Solved]

热度:7   发布时间:2023-12-12 01:01:13.0

from caffe2.python import workspace
Traceback (most recent call last):
File “”, line 1, in
File “/home/reallocing/anaconda27/lib/python2.7/site-packages/caffe2/python/init.py”, line 2, in
from caffe2.proto import caffe2_pb2
File “/home/reallocing/anaconda27/lib/python2.7/site-packages/caffe2/proto/caffe2_pb2.py”, line 220, in
options=None, file=DESCRIPTOR),
TypeError: new() got an unexpected keyword argument ‘file’

安装protobuf进行解决:

conda install protobuf
  相关解决方案