TimoSaemann / caffe-segnet-cudnn5

This repository was a fork of BVLC/caffe and includes the upsample, bn, dense_image_data and softmax_with_loss (with class weighting) layers of caffe-segnet (https://github.com/alexgkendall/caffe-segnet) to run SegNet with cuDNN version 5.
Other
176 stars 127 forks source link

compute_bn_statistics.py fails #12

Closed codyreading closed 7 years ago

codyreading commented 7 years ago

Issue summary

When following the Segnet tutorial, the following error is experienced when running the compute_bn_statistics.py script after training a model for Segnet:

Building BN calc net... Traceback (most recent call last): File "Scripts/compute_bn_statistics.py", line 175, in testable_msg = make_testable(args.train_model) File "Scripts/compute_bn_statistics.py", line 38, in make_testable text_format.Merge(train_str, train_net) File "/usr/local/lib/python2.7/dist-packages/google/protobuf/text_format.py", line 476, in Merge descriptor_pool=descriptor_pool) File "/usr/local/lib/python2.7/dist-packages/google/protobuf/text_format.py", line 526, in MergeLines return parser.MergeLines(lines, message) File "/usr/local/lib/python2.7/dist-packages/google/protobuf/text_format.py", line 559, in MergeLines self._ParseOrMerge(lines, message) File "/usr/local/lib/python2.7/dist-packages/google/protobuf/text_format.py", line 574, in _ParseOrMerge self._MergeField(tokenizer, message) File "/usr/local/lib/python2.7/dist-packages/google/protobuf/text_format.py", line 675, in _MergeField merger(tokenizer, message, field) File "/usr/local/lib/python2.7/dist-packages/google/protobuf/text_format.py", line 764, in _MergeMessageField self._MergeField(tokenizer, sub_message) File "/usr/local/lib/python2.7/dist-packages/google/protobuf/text_format.py", line 643, in _MergeField (message_descriptor.full_name, name)) google.protobuf.text_format.ParseError: 7:3 : Message type "caffe.LayerParameter" has no field named "dense_image_data_param".

Steps to reproduce

1) Train using the segnet solver model: ./caffe-segnet-cudnn5/build/tools/caffe train -gpu all -solver Models/segnet_solver.prototxt 2) Run nnuser@gsd-pc2:~/SegNet-Tutorial$ python Scripts/compute_bn_statistics.py Models/segnet_train.prototxt Models/Training/segnet_iter_100000.caffemodel Models/Inference/

I have attached my Makefile.config and cmake output: Makefile .txt cmake_output.txt

System configuration

Operating system: Ubuntu 16.04 LTS Compiler: CMake CUDA version (if applicable): 8.0 CUDNN version (if applicable): 5.1 BLAS: Attlas Python or MATLAB version (for pycaffe and matcaffe respectively): Python 2.7

TimoSaemann commented 7 years ago

Are you sure you have specified the correct caffe root in the compute_bn_statistics.py script? caffe_root = '/home/user/caffe-segnet-cudnn5/'

codyreading commented 7 years ago

Yep I have done that, for my directory it is caffe_root = '/home/user/Segnet-Tutorial/caffe-segnet-cudnn5/

TimoSaemann commented 7 years ago

The error message indicates that caffe-segnet-cudnn5 doesn't contain the _dense_image_dataparam. If that's really the case, you could not have started the training of SegNet. Then the same error would have appeared. And I also can not reproduce this issue.

Please make sure you use the latest caffe-segnet-cudnn5. If it is not working, you can also try the caffe-segnet repository.

codyreading commented 7 years ago

I have tried the latest version of caffe-segnet-cudnn5, I would like to use this with the cuDNN v5.1.

The error occurs at the line text_format.Merge(train_str, train_net). Is it possible this will not work with cuDNN v5.1?

nathanin commented 7 years ago

Check out src/caffe/proto/caffe.proto and ctrl+F for dense_image_data_param. As I understand, this is where the layers and their parameters are defined. Not to do with cuDNN v5.1. Again, if you were able to train using a DenseImageData layer, then the problem is somewhere else. Could there be more than one python on your machine? Try making sure you're using the same python that you compiled caffe-segnet-cudnn5 with.

codyreading commented 7 years ago

Checked the python version, am using Python 2.7 and caffe-segnet-cudnn5 was compiled with 2.7. Additionaly dense_image_data_param is included in the caffe.proto file.

codyreading commented 7 years ago

I have also attached the cmake output in the original post

TimoSaemann commented 7 years ago

Closing this, since it is due to an application error.