7oud opened a new issue #13863: Which conv layer should be selected as the last 
conv layer in gradcam example when using resnet50v2?
URL: https://github.com/apache/incubator-mxnet/issues/13863
 
 
   ## Description
   I followed the "Visualizing Decisions of Convolutional Neural Networks", and 
it gives the correct output images when using vgg16 pretrained model. ThenI 
changed the network to ResNet50v2 with its pretrained model, but the output 
images looks abnormal, Some code snippet are as follow.
   `
       # ResNetV2 using gradcam's Conv2D and Activation
       net = ResNetV2(BottleneckV2, layers, channels, **kwargs)
       net.initialize(ctx=ctx)
   
       resnet50v2 = mx.gluon.model_zoo.vision.resnet50_v2()
       # load pretrain model
       
resnet50v2.load_parameters('D:/Model/mxnet/models/resnet50_v2-ecdde353.params', 
ctx=ctx)
       params = resnet50v2.collect_params()
       for key in params:
           param = params[key]
           net.collect_params()[net.prefix + key.replace(resnet50v2.prefix, 
'')].set_data(param.data())
   
       # ...
       last_conv_layer_name = network.features[8][2].conv3.name
       show_images(*visualize(network, "hummingbird.jpg", last_conv_layer_name))
   `
   
   ![Uploading Figure_1.png…]()
   The upper row uses resnet pretrained model, and the lower row uses vgg16 
model
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to