dilation icon indicating copy to clipboard operation
dilation copied to clipboard

trainning error:AttributeError: 'module' object has no attribute 'ImageLabelDataParameter'

Open XiangChen1994 opened this issue 8 years ago • 7 comments

when I run the train.py ,I get this error: Traceback (most recent call last): File "train.py", line 251, in main() File "train.py", line 235, in main train_net, test_net = make_nets(options) File "train.py", line 112, in make_nets train_net = make_net(options, True) File "train.py", line 108, in make_net return globals()['make_' + options.model](options, is_training) File "train.py", line 55, in make_frontend_vgg is_training, options.crop_size, options.mean) File "/home/eric118/git/dilation/network.py", line 25, in make_image_label_data padding=P.ImageLabelData.REFLECT, File "/home/eric118/git/dilation/caffe-master/python/caffe/net_spec.py", line 220, in getattr return getattr(getattr(caffe_pb2, name + 'Parameter'), param_name) AttributeError: 'module' object has no attribute 'ImageLabelDataParameter' How can I fix it? Thank you very much!

XiangChen1994 avatar Oct 11 '16 07:10 XiangChen1994

Did you use my caffe for training? https://github.com/fyu/caffe-dilation

It is not necessary to run prediction.

fyu avatar Oct 11 '16 17:10 fyu

yeah,I forgot to change caffe-root , I used another caffe before. Thanks!

XiangChen1994 avatar Oct 13 '16 01:10 XiangChen1994

Hi all, Sorry, I have the same question, and I have already added the ${BUILD_DIR}/build_master/python into my PYTHONPATH, but it still appears the same error.

There is another stranger thing, after I make pycaffe, there is no caffe_pb2 in ${BUILD_DIR}/build_master/python/caffe/proto, and I try to copy it from original caffe which is already built, is it ok?

Thanks!

vigorous0503 avatar Oct 24 '16 01:10 vigorous0503

@vigorous0503 if caffe_pb2 doesn't exist, you can try to make clean and build the binary again. See if that solves your problem.

If you copy caffe_pb2 from original caffe, you will get the above error, since ImageLabelDataParameter doesn't exist in the original caffe.

fyu avatar Oct 24 '16 01:10 fyu

I tried to use your caffe, and import caffe in the train.py, however, it turns out ImportError: No module named _caffe. When I use another caffe in predict.py, it works well. I don't know how to fix it. Could you help me? Thank you! It seems that some files in ../caffe-dilation/python/caffe/ failed to be generate...?

ghost avatar Oct 31 '16 14:10 ghost

@Dandue Please check README of caffe-dilation. Or https://github.com/fyu/dilation/issues/11

fyu avatar Oct 31 '16 20:10 fyu

"Make sure that the Caffe version is newer than commit 08c5df." So I use the latest version of caffe. But it still turns out AttributeError: 'module' object has no attribute 'ImageLabelDataParameter'. I also have changed the path of caffe root. Is it necessary for us to use the version of your own caffe? https://github.com/fyu/caffe-dilation What about other newer version of caffe? Thank you very much!

lillyro avatar Aug 01 '18 01:08 lillyro