yosinski / deep-visualization-toolbox

DeepVis Toolbox
http://yosinski.com/deepvis
MIT License
4.01k stars 927 forks source link

Visualization of SSD network #116

Closed Bardo91 closed 6 years ago

Bardo91 commented 7 years ago

I am trying to visualize a model trained from https://github.com/weiliu89/caffe/tree/ssd. But I am getting the following error while running the tool:

Traceback (most recent call last):
  File "./run_toolbox.py", line 33, in <module>
    main()
  File "./run_toolbox.py", line 23, in main
    lv = LiveVis(settings)
  File "/home/bardo91/programming/3dparty/deep-visualization-toolbox/live_vis.py", line 62, in __init__
    app = app_class(settings, self.bindings)
  File "/home/bardo91/programming/3dparty/deep-visualization-toolbox/caffevis/app.py", line 101, in __init__
    self._populate_net_layer_info()
  File "/home/bardo91/programming/3dparty/deep-visualization-toolbox/caffevis/app.py", line 114, in _populate_net_layer_info
    assert len(blob_shape) in (2,4), 'Expected either 2 for FC or 4 for conv layer'
AssertionError: Expected either 2 for FC or 4 for conv layer

Is it some incompatibility of the tool with the network?

These are the settings and the proto model (I added .txt at the end to be able to upload them) settings_local.py.txt deploy.prototxt.txt

physicso commented 7 years ago

For my case, I have printed out the blob_shape and find that the shape of the last layer is empty. Therefore its length is zero, which leads to this error. I have simply deleted the last loss layer and everything works well :)

shonehang commented 7 years ago

I am trying to visualize a model trained from SSD too, I meet this mistake:

Cannot copy param 0 weights from layer 'conv4_3_norm_mbox_conf'; shape mismatch. Source param shape is 8 512 3 3 (36864);target param shape is 12 512 3 3 (55296). To learn this layer's parameters from scratch rather than copying from a saved net, rename the layer.

Now, I solved it, because the deploy.prototxt I used is not the prototxt I trained before, I change the prototxt and the mistake is solved.

lux1994 commented 6 years ago

@shonehang For the SSD case, would you mind to tell which files are those that you modified? Thank you very much!

Tahirhan commented 6 years ago

go into the your caffe-ssd install path , use ./python/draw_net.py /path/to/your/prototxt_file/train.prototxt network.jpg