alexgkendall / SegNet-Tutorial

Files for a tutorial to train SegNet for road scenes using the CamVid dataset
http://mi.eng.cam.ac.uk/projects/segnet/tutorial.html
847 stars 517 forks source link

KeyError 'argmax" in Scripts/webcam_demo.py #98

Open ThomasLengeling opened 7 years ago

ThomasLengeling commented 7 years ago

Hi, I followed the tutorial and successfully trained and evaluated the model, and the test_segmentation_camvid is working fine.

When I run python /home/tom/SegNet/Scripts/webcam_demo.py --model /home/tom/SegNet/Models/segnet_basic_inference.prototxt --weights /home/tom/SegNet/Models/Inference/test_weights.caffemodel --colours /Scripts/camvid12.png

I get the following error:

Traceback (most recent call last):
  File "/home/tom/SegNet/Scripts/webcam_demo.py", line 32, in <module>
    output_shape = net.blobs['argmax'].data.shape

Any suggestions? Thank you very much for the help. Thomas

ThomasLengeling commented 7 years ago

Ok, got it to work using this

https://github.com/alexgkendall/SegNet-Tutorial/issues/55

however, I am getting the following error, any suggestions?

Traceback (most recent call last):
  File "/home/tom/SegNet/Scripts/webcam_demo_pro.py", line 62, in <module>
    out = net.forward_all(data=input_image)
  File "/home/tom/SegNet/caffe-segnet/python/caffe/pycaffe.py", line 192, in _Net_forward_all
    outs = self.forward(blobs=blobs, **batch)
  File "/home/tom/SegNet/caffe-segnet/python/caffe/pycaffe.py", line 113, in _Net_forward
    raise Exception('Input blob arguments do not match net inputs.')
Exception: Input blob arguments do not match net inputs.

Thomas

ThomasLengeling commented 7 years ago

This is using the File /home/tom/SegNet/Scripts/webcam_demo.py" example

xhy3054 commented 6 years ago

did you solve it? I encountered the same problem

radisc commented 4 years ago

I'm stuck with the same exception

edit: i made it work by changin out = net.forward_all(data=input_image) to out = net.forward() but now i'm having the same problem as #17 , altough my code is a little different ( i had to change 'argmax' to 'prob' )