question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't find my own model's layer name

See original GitHub issue

Dear @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 image 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:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Sibozhucommented, Jan 26, 2019

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!  本当にありがとうございました!

1reaction
kazuto1011commented, Jan 25, 2019

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 print self.gradient or insert any commands into the hook function.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found