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

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

Open
SJTUsuperxu opened this issue Feb 16, 2017 · 5 comments
Open

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

SJTUsuperxu opened this issue Feb 16, 2017 · 5 comments

Comments

@SJTUsuperxu
Copy link

SJTUsuperxu commented Feb 16, 2017

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 SJTUsuperxu changed the title Questions about meaning that displays on screen when training AttributeError: 'NoneType' object has no attribute 'transpose' Feb 16, 2017
@SJTUsuperxu
Copy link
Author

SJTUsuperxu commented Feb 16, 2017

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

@SJTUsuperxu
Copy link
Author

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
Copy link

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
Copy link
Author

SJTUsuperxu commented Jun 13, 2017 via email

@ily12
Copy link

ily12 commented Dec 26, 2022

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?

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

3 participants