NVIDIA-AI-IOT / redtail

Perception and AI components for autonomous mobile robotics.
BSD 3-Clause "New" or "Revised" License
1.01k stars 344 forks source link

How to use VisualBackProp #63

Closed zhong-xin closed 6 years ago

zhong-xin commented 6 years ago

我现在想做出这种可视化的效果(https://www.youtube.com/watch?v=4_TmPA-qw9U&t=8)。 但是在使用VisualBackProp提供的方法时,需要一个.t7b的文件。我在用caffemodel生成.t7b文件时,发生如下错误。

xin@xin-X10DAi-Invalid-entry-length-16-Fixed-up-to-11:~/pytorch-vgg-master$ th caffemodel_to_t7.lua [libprotobuf ERROR google/protobuf/text_format.cc:288] Error parsing text-format caffe.NetParameter: 43:15: Message type "caffe.LayerParameter" has no field named "scale_param". Successfully loaded /home/xin/pytorch-vgg-master/snapshot_iter_2320.caffemodel warning: module 'train-data [type Data]' not found warning: module 'data_aug [type Python]' not found warning: module 'sub_mean [type Scale]' not found warning: module 'conv1_srelu1_1 [type Scale]' not found warning: module 'conv1_srelu1_3 [type Scale]' not found warning: module 'pool1_pool1_0_split [type Split]' not found warning: module 'res1_1_1_srelu_1 [type Scale]' not found warning: module 'res1_1_1_srelu_3 [type Scale]' not found warning: module 'res1_1_sum [type Eltwise]' not found warning: module 'res1_1_srelu_1 [type Scale]' not found warning: module 'res1_1_srelu_3 [type Scale]' not found warning: module 'res1_1_res1_1_srelu_3_0_split [type Split]' not found warning: module 'res1_2_1_srelu_1 [type Scale]' not found warning: module 'res1_2_1_srelu_3 [type Scale]' not found warning: module 'res1_2_sum [type Eltwise]' not found warning: module 'res1_2_srelu_1 [type Scale]' not found warning: module 'res1_2_srelu_3 [type Scale]' not found warning: module 'res1_2_res1_2_srelu_3_0_split [type Split]' not found warning: module 'res2_1_1_srelu_1 [type Scale]' not found warning: module 'res2_1_1_srelu_3 [type Scale]' not found warning: module 'res2_1_sum [type Eltwise]' not found warning: module 'res2_1_srelu_1 [type Scale]' not found warning: module 'res2_1_srelu_3 [type Scale]' not found warning: module 'res2_1_res2_1_srelu_3_0_split [type Split]' not found warning: module 'res2_2_1_srelu_1 [type Scale]' not found warning: module 'res2_2_1_srelu_3 [type Scale]' not found warning: module 'res2_2_sum [type Eltwise]' not found warning: module 'res2_2_srelu_1 [type Scale]' not found warning: module 'res2_2_srelu_3 [type Scale]' not found warning: module 'res2_2_res2_2_srelu_3_0_split [type Split]' not found warning: module 'res3_1_1_srelu_1 [type Scale]' not found warning: module 'res3_1_1_srelu_3 [type Scale]' not found warning: module 'res3_1_sum [type Eltwise]' not found warning: module 'res3_1_srelu_1 [type Scale]' not found warning: module 'res3_1_srelu_3 [type Scale]' not found warning: module 'res3_1_res3_1_srelu_3_0_split [type Split]' not found warning: module 'res3_2_1_srelu_1 [type Scale]' not found warning: module 'res3_2_1_srelu_3 [type Scale]' not found warning: module 'res3_2_sum [type Eltwise]' not found warning: module 'res3_2_srelu_1 [type Scale]' not found warning: module 'res3_2_srelu_3 [type Scale]' not found warning: module 'res3_2_res3_2_srelu_3_0_split [type Split]' not found warning: module 'res4_1_1_srelu_1 [type Scale]' not found warning: module 'res4_1_1_srelu_3 [type Scale]' not found warning: module 'res4_1_sum [type Eltwise]' not found warning: module 'res4_1_srelu_1 [type Scale]' not found warning: module 'res4_1_srelu_3 [type Scale]' not found warning: module 'res4_1_res4_1_srelu_3_0_split [type Split]' not found warning: module 'res4_2_1_srelu_1 [type Scale]' not found warning: module 'res4_2_1_srelu_3 [type Scale]' not found warning: module 'res4_2_sum [type Eltwise]' not found warning: module 'res4_2_srelu_1 [type Scale]' not found warning: module 'res4_2_srelu_3 [type Scale]' not found warning: module 'pool_avg_pool_avg_0_split [type Split]' not found warning: module 'cee_loss [type Python]' not found conv1: 64 3 7 7 res1_1_1: 64 64 3 3 res1_1_2: 64 64 3 3 res1_2_1: 64 64 3 3 res1_2_2: 64 64 3 3 res2_1_1: 128 64 3 3 res2_1_2: 128 128 3 3 res2_1_proj: 128 64 1 1 res2_2_1: 128 128 3 3 res2_2_2: 128 128 3 3 res3_1_1: 256 128 3 3 res3_1_2: 256 256 3 3 res3_1_proj: 256 128 1 1 res3_2_1: 256 256 3 3 res3_2_2: 256 256 3 3 res4_1_1: 512 256 3 3 res4_1_2: 512 512 3 3 res4_1_proj: 512 256 1 1 res4_2_1: 512 512 3 3 res4_2_2: 512 512 3 3 fc3: 1 1 512 3 fc3_t: 1 1 512 3 /home/xin/torch/install/bin/lua: caffemodel_to_t7.lua:26: assertion failed! stack traceback: C: in function 'assert' caffemodel_to_t7.lua:26: in main chunk C: in function 'dofile' .../torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk

Tanks for your help.

Alexey-Kamenev commented 6 years ago

We did not use pytorch (it did not even exist when we started the project) so I'm not familiar with that particular implementation of visual backprop. We used a script which converted original TrailNet caffe model to another caffe model that resembled the one you would get by applying visual backprop method. Those scripts never made into release as they were not particularly easy to use. I think that these days it can be done much easier with pytorch or TensorFlow. You would need to convert our TrailNet caffe model to your target framework and then implement visual backprop.

liuzhenboo commented 3 years ago

我现在想做出这种可视化的效果(https://www.youtube.com/watch?v=4_TmPA-qw9U&t=8)。%E3%80%82) 但是在使用VisualBackProp提供的方法时,需要一个.t7b的文件。我在用caffemodel生成.t7b文件时,发生如下错误。

xin@xin-X10DAi-Invalid-entry-length-16-Fixed-up-to-11:~/pytorch-vgg-master$ th caffemodel_to_t7.lua [libprotobuf ERROR google/protobuf/text_format.cc:288] Error parsing text-format caffe.NetParameter: 43:15: Message type "caffe.LayerParameter" has no field named "scale_param". Successfully loaded /home/xin/pytorch-vgg-master/snapshot_iter_2320.caffemodel warning: module 'train-data [type Data]' not found warning: module 'data_aug [type Python]' not found warning: module 'sub_mean [type Scale]' not found warning: module 'conv1_srelu1_1 [type Scale]' not found warning: module 'conv1_srelu1_3 [type Scale]' not found warning: module 'pool1_pool1_0_split [type Split]' not found warning: module 'res1_1_1_srelu_1 [type Scale]' not found warning: module 'res1_1_1_srelu_3 [type Scale]' not found warning: module 'res1_1_sum [type Eltwise]' not found warning: module 'res1_1_srelu_1 [type Scale]' not found warning: module 'res1_1_srelu_3 [type Scale]' not found warning: module 'res1_1_res1_1_srelu_3_0_split [type Split]' not found warning: module 'res1_2_1_srelu_1 [type Scale]' not found warning: module 'res1_2_1_srelu_3 [type Scale]' not found warning: module 'res1_2_sum [type Eltwise]' not found warning: module 'res1_2_srelu_1 [type Scale]' not found warning: module 'res1_2_srelu_3 [type Scale]' not found warning: module 'res1_2_res1_2_srelu_3_0_split [type Split]' not found warning: module 'res2_1_1_srelu_1 [type Scale]' not found warning: module 'res2_1_1_srelu_3 [type Scale]' not found warning: module 'res2_1_sum [type Eltwise]' not found warning: module 'res2_1_srelu_1 [type Scale]' not found warning: module 'res2_1_srelu_3 [type Scale]' not found warning: module 'res2_1_res2_1_srelu_3_0_split [type Split]' not found warning: module 'res2_2_1_srelu_1 [type Scale]' not found warning: module 'res2_2_1_srelu_3 [type Scale]' not found warning: module 'res2_2_sum [type Eltwise]' not found warning: module 'res2_2_srelu_1 [type Scale]' not found warning: module 'res2_2_srelu_3 [type Scale]' not found warning: module 'res2_2_res2_2_srelu_3_0_split [type Split]' not found warning: module 'res3_1_1_srelu_1 [type Scale]' not found warning: module 'res3_1_1_srelu_3 [type Scale]' not found warning: module 'res3_1_sum [type Eltwise]' not found warning: module 'res3_1_srelu_1 [type Scale]' not found warning: module 'res3_1_srelu_3 [type Scale]' not found warning: module 'res3_1_res3_1_srelu_3_0_split [type Split]' not found warning: module 'res3_2_1_srelu_1 [type Scale]' not found warning: module 'res3_2_1_srelu_3 [type Scale]' not found warning: module 'res3_2_sum [type Eltwise]' not found warning: module 'res3_2_srelu_1 [type Scale]' not found warning: module 'res3_2_srelu_3 [type Scale]' not found warning: module 'res3_2_res3_2_srelu_3_0_split [type Split]' not found warning: module 'res4_1_1_srelu_1 [type Scale]' not found warning: module 'res4_1_1_srelu_3 [type Scale]' not found warning: module 'res4_1_sum [type Eltwise]' not found warning: module 'res4_1_srelu_1 [type Scale]' not found warning: module 'res4_1_srelu_3 [type Scale]' not found warning: module 'res4_1_res4_1_srelu_3_0_split [type Split]' not found warning: module 'res4_2_1_srelu_1 [type Scale]' not found warning: module 'res4_2_1_srelu_3 [type Scale]' not found warning: module 'res4_2_sum [type Eltwise]' not found warning: module 'res4_2_srelu_1 [type Scale]' not found warning: module 'res4_2_srelu_3 [type Scale]' not found warning: module 'pool_avg_pool_avg_0_split [type Split]' not found warning: module 'cee_loss [type Python]' not found conv1: 64 3 7 7 res1_1_1: 64 64 3 3 res1_1_2: 64 64 3 3 res1_2_1: 64 64 3 3 res1_2_2: 64 64 3 3 res2_1_1: 128 64 3 3 res2_1_2: 128 128 3 3 res2_1_proj: 128 64 1 1 res2_2_1: 128 128 3 3 res2_2_2: 128 128 3 3 res3_1_1: 256 128 3 3 res3_1_2: 256 256 3 3 res3_1_proj: 256 128 1 1 res3_2_1: 256 256 3 3 res3_2_2: 256 256 3 3 res4_1_1: 512 256 3 3 res4_1_2: 512 512 3 3 res4_1_proj: 512 256 1 1 res4_2_1: 512 512 3 3 res4_2_2: 512 512 3 3 fc3: 1 1 512 3 fc3_t: 1 1 512 3 /home/xin/torch/install/bin/lua: caffemodel_to_t7.lua:26: assertion failed! stack traceback: C: in function 'assert' caffemodel_to_t7.lua:26: in main chunk C: in function 'dofile' .../torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:150: in main chunk

Tanks for your help.

兄弟,最后弄好了吗?