Can't find my own model's layer name
See original GitHub issueDear @kazuto1011 Thank you so much for this amazing repo. I have one question regarding the customized model engaging. When I used a YOLOv3 model in this project, I used your script of finding layer name print(*list(model.named_modules()), sep='\n')
and I get
However, as you can see in the error below it doesn’t recognize it as a valid layer name. Do you have any idea of this?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
In Keras, how to get the layer name associated with a "Model ...
The key is to first do .get_layer on the Model object, ... To get the name of the layer from the VGG16 instance...
Read more >Layer Names in Layer Properties Manager Don't Show Up in ...
For some reason, the names of the layers don't show up in the Layer Properties Manager while she's in the model space. However,...
Read more >keras get layer of the model - AI Pool
If you visualize your Keras model, you will see something like this. It says the name ... Every layer of the Keras model...
Read more >How to access to a layer by module name? - PyTorch Forums
I used named_modules() method to get the layers. for name, layer in model.named_modules(): if isinstance(layer, nn.ReLU): print(name, layer).
Read more >Rename layer in model builder with almost original name
2- Use the 'Load layer in the project'. The problem of this is that there is no output in the model there is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you so much! I solved the issue eventually. Indeed it was because I lose the hook of backward when I load my own model. After all, everything works perfectly! 本当にありがとうございました!
Although I don’t know how you adapted to the detection model, please verify that you run GradCAM backward and enable autograd (don’t call
torch.set_grad_enabled(False)
,with torch.no_grad()
, etc.). To validate the backward, you can printself.gradient
or insert any commands into the hook function.