Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

failed to run "./convert.py examples/mnist/lenet.prototxt --code-output-path=mynet.py" #164

Open
dinglong1020 opened this issue Mar 25, 2018 · 5 comments

Comments

@dinglong1020
Copy link

environment: ubuntu1604 python2.7 tensorflow1.6(only cpu)

(tensorflow) ubuntu@vm:~/workspace/08_fine_train/fine-tune-alexnet/caffe-tensorflow$ ./convert.py examples/mnist/lenet.prototxt --code-output-path=mynet.py
/usr/local/lib/python2.7/dist-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
Traceback (most recent call last):
File "./convert.py", line 60, in
main()
File "./convert.py", line 56, in main
args.phase)
File "./convert.py", line 27, in convert
transformer = TensorFlowTransformer(def_path, caffemodel_path, phase=phase)
File "/home/ubuntu/workspace/08_fine_train/fine-tune-alexnet/caffe-tensorflow/kaffe/tensorflow/transformer.py", line 221, in init
self.load(def_path, data_path, phase)
File "/home/ubuntu/workspace/08_fine_train/fine-tune-alexnet/caffe-tensorflow/kaffe/tensorflow/transformer.py", line 227, in load
graph = GraphBuilder(def_path, phase).build()
File "/home/ubuntu/workspace/08_fine_train/fine-tune-alexnet/caffe-tensorflow/kaffe/graph.py", line 140, in init
self.load()
File "/home/ubuntu/workspace/08_fine_train/fine-tune-alexnet/caffe-tensorflow/kaffe/graph.py", line 144, in load
self.params = get_caffe_resolver().NetParameter()
File "/home/ubuntu/workspace/08_fine_train/fine-tune-alexnet/caffe-tensorflow/kaffe/caffe/resolver.py", line 32, in get_caffe_resolver
SHARED_CAFFE_RESOLVER = CaffeResolver()
File "/home/ubuntu/workspace/08_fine_train/fine-tune-alexnet/caffe-tensorflow/kaffe/caffe/resolver.py", line 7, in init
self.import_caffe()
File "/home/ubuntu/workspace/08_fine_train/fine-tune-alexnet/caffe-tensorflow/kaffe/caffe/resolver.py", line 23, in import_caffe
self.caffepb = self.caffe.proto.caffe_pb2
AttributeError: 'module' object has no attribute 'proto'

@dinglong1020
Copy link
Author

(tensorflow) ubuntu@vm:~/workspace/08_fine_train/fine-tune-alexnet/caffe-tensorflow$ ./convert.py examples/mnist/lenet.prototxt --caffemodel examples/mnist/lenet_iter_10000.caffemodel --data-output-path=mynet.npy
/usr/local/lib/python2.7/dist-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
Traceback (most recent call last):
File "./convert.py", line 60, in
main()
File "./convert.py", line 56, in main
args.phase)
File "./convert.py", line 27, in convert
transformer = TensorFlowTransformer(def_path, caffemodel_path, phase=phase)
File "/home/ubuntu/workspace/08_fine_train/fine-tune-alexnet/caffe-tensorflow/kaffe/tensorflow/transformer.py", line 221, in init
self.load(def_path, data_path, phase)
File "/home/ubuntu/workspace/08_fine_train/fine-tune-alexnet/caffe-tensorflow/kaffe/tensorflow/transformer.py", line 231, in load
graph = DataInjector(def_path, data_path)(graph)
File "/home/ubuntu/workspace/08_fine_train/fine-tune-alexnet/caffe-tensorflow/kaffe/transformers.py", line 29, in init
self.load()
File "/home/ubuntu/workspace/08_fine_train/fine-tune-alexnet/caffe-tensorflow/kaffe/transformers.py", line 33, in load
self.load_using_caffe()
File "/home/ubuntu/workspace/08_fine_train/fine-tune-alexnet/caffe-tensorflow/kaffe/transformers.py", line 39, in load_using_caffe
net = caffe.Net(self.def_path, self.data_path, caffe.TEST)
AttributeError: 'module' object has no attribute 'Net'

@myth01
Copy link

myth01 commented Apr 13, 2018

How have you solved
AttributeError: module 'caffe' has no attribute 'proto'

@shreyaspimpalgaonkar
Copy link

try pip install protobuf

@Jeep-Z
Copy link

Jeep-Z commented Sep 17, 2018

@dinglong1020 How did you fix "AttributeError: 'module' object has no attribute 'proto'"?

@vishal83
Copy link

Also, @dinglong1020 How did you fix "AttributeError: 'caffe' has no attribute 'proto'"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants