martinkersner / train-DeepLab

Train DeepLab for Semantic Image Segmentation
MIT License
172 stars 76 forks source link

AttributeError: 'NoneType' object has no attribute 'transpose' #22

Open SJTUsuperxu opened 7 years ago

SJTUsuperxu commented 7 years ago

Hello @martinkersner
Thank you for your kind instructions and currently I can train my model on my own. But when I want to use deeplab.py to test a image, I got errors as following: File "/home/xjw/train-DeepLab/segmenter.py", line 29, in predict img = inputs[0].transpose((2, 0, 1)) AttributeError: 'NoneType' object has no attribute 'transpose' I was wondering how to solve it. Thank you again.

SJTUsuperxu commented 7 years ago

@koizora223
Hi, I saw you have implemented this successfully, can you help me? Thank you very much~

SJTUsuperxu commented 7 years ago

By the way, my command is: python deeplab.py 1 ./DeepLab-LargeFOV/deploy21.prototxt ./exper/voc12/model/DeepLab-LargeFOV/train_iter_6000.caffemodel ./exper/voc12/list/images_orig/2008_000219.jpg

zhangrui0828 commented 7 years ago

Hi SJTUsuperxu, you have trained the model successfully. My configuration is as following: The DeepLab model : DeepLab_LargeFOV. Dataset: original PASCAL VOC12. Init model is vgg16_20M. Solver: exper/voc12/config/DeepLab_LargeFOV/solver_train.prototxt train_net: exper/voc12/config/DeepLab_LargeFOV/train_train.prototxt source: exper/voc12/list/train.txt

When I run run_pascal_strong.sh, an error always occur and I can't further proceed. The error is shown below. …... I0612 15:44:39.689864 12910 net.cpp:208] This network produces output accuracy I0612 15:44:39.689891 12910 net.cpp:467] Collecting Learning Rate and Weight Decay. I0612 15:44:39.689899 12910 net.cpp:219] Network initialization done. I0612 15:44:39.689903 12910 net.cpp:220] Memory required for data: 3663953152 I0612 15:44:39.689975 12910 solver.cpp:41] Solver scaffolding done. I0612 15:44:39.689981 12910 solver.cpp:160] Solving DeepLab-LargeFOV I0612 15:44:39.689985 12910 solver.cpp:161] Learning Rate Policy: step F0612 15:44:41.198884 12910 softmax_loss_layer.cpp:86] Unexpected label 19 Check failure stack trace: @ 0x7efefd561daa (unknown) @ 0x7efefd561ce4 (unknown) @ 0x7efefd5616e6 (unknown) @ 0x7efefd564687 (unknown) @ 0x5482a8 caffe::SoftmaxWithLossLayer<>::Forward_cpu() @ 0x47413a caffe::Net<>::ForwardFromTo() @ 0x4743cf caffe::Net<>::ForwardPrefilled() @ 0x57a320 caffe::Solver<>::Solve() @ 0x419be8 train() @ 0x412278 main @ 0x7efefa399f45 (unknown) @ 0x417927 (unknown) @ (nil) (unknown) Aborted

The number after “Unpexted label” is always different at every time. Do you have any ideas on this? That would be really greatful. Thanks!

SJTUsuperxu commented 7 years ago

I use the net for foreground segmentation thus I use binary labels (0 and 1). I think if u try semantic segmentation u might need to set labels to (0 1 2 3…) NOT just arbitrarily setting.

在 2017年6月13日,09:32,zhangrui0828 notifications@github.com 写道:

Hi SJTUsuperxu, you have trained the model successfully. My configuration is as following: The DeepLab model : DeepLab_LargeFOV. Dataset: original PASCAL VOC12. Init model is vgg16_20M. Solver: exper/voc12/config/DeepLab_LargeFOV/solver_train.prototxt train_net: exper/voc12/config/DeepLab_LargeFOV/train_train.prototxt source: exper/voc12/list/train.txt

When I run run_pascal_strong.sh, an error always occur and I can't further proceed. The error is shown below. …... I0612 15:44:39.689864 12910 net.cpp:208] This network produces output accuracy I0612 15:44:39.689891 12910 net.cpp:467] Collecting Learning Rate and Weight Decay. I0612 15:44:39.689899 12910 net.cpp:219] Network initialization done. I0612 15:44:39.689903 12910 net.cpp:220] Memory required for data: 3663953152 I0612 15:44:39.689975 12910 solver.cpp:41] Solver scaffolding done. I0612 15:44:39.689981 12910 solver.cpp:160] Solving DeepLab-LargeFOV I0612 15:44:39.689985 12910 solver.cpp:161] Learning Rate Policy: step F0612 15:44:41.198884 12910 softmax_loss_layer.cpp:86] Unexpected label 19 Check failure stack trace: @ 0x7efefd561daa (unknown) @ 0x7efefd561ce4 (unknown) @ 0x7efefd5616e6 (unknown) @ 0x7efefd564687 (unknown) @ 0x5482a8 caffe::SoftmaxWithLossLayer<>::Forward_cpu() @ 0x47413a caffe::Net<>::ForwardFromTo() @ 0x4743cf caffe::Net<>::ForwardPrefilled() @ 0x57a320 caffe::Solver<>::Solve() @ 0x419be8 train() @ 0x412278 main @ 0x7efefa399f45 (unknown) @ 0x417927 (unknown) @ (nil) (unknown) Aborted

The number after “Unpexted label” is always different at every time. Do you have any ideas on this? That would be really greatful. Thanks!

― You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

ily12 commented 1 year ago

When calculating SSIM,code is: img1 = img1.data.cpu().numpy().astype(np.float64) img2 = img2.data.cpu().numpy().astype(np.float64) kernel = cv2.getGaussianKernel(11, 1.5) window = np.outer(kernel, kernel.transpose()) there has a bug:AttributeError: 'NoneType' object has no attribute 'transpose',how to solve it?