You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since IntermediateLayerGetter is using the .named_children method of torch.nn.Module, the accepted layers cannot be a layer that is referenced multiple times in the architecture. Using the private ._modules.items() method of the same object would fix it though. Happy to open a PR if you think it's a good idea
Indeed, this is a current limitation with IntermediateLayerGetter. IntermediateLayerGetter is very fragile and only supports a very limited set of use-cases, but we are actively looking into improving it, with the next iteration of it present in #3597
Also, a note of warning: IntermediateLayerGetter is a private API for now (present in _utils), so we might break its API without deprecation warnings.
Apologies, I left those notifications to make sure I had time investigating the corresponding PR. Thanks a lot @fmassa, that looks exactly like what was needed 🙏
Uh oh!
There was an error while loading. Please reload this page.
🐛 Minor trouble with IntermediateLayerGetter
Since
IntermediateLayerGetter
is using the.named_children
method oftorch.nn.Module
, the accepted layers cannot be a layer that is referenced multiple times in the architecture. Using the private._modules.items()
method of the same object would fix it though. Happy to open a PR if you think it's a good ideaTo Reproduce
raises
Expected behavior
The above snippet should be working without raising any error
Environment
conda
The text was updated successfully, but these errors were encountered: