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
Currently, hooks store values in module.output this causes an issue when using any model that uses .output to store an nn.Module attribute. It's a very generic name that can collide with a variety of modules. As such, I cannot run backpack-for-pytorch on huggingface bert models. It would be better if the name was something more specific, even just backpack_for_pytorch_output or even backpack_output to prevent collisions with attributes of the module.
Creates an error similar:
/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py in __setattr__(self, name, value)
1982 elif modules is not None and name in modules:
1983 if value is not None:
-> 1984 raise TypeError(
1985 f"cannot assign '{torch.typename(value)}' as child module '{name}' "
1986 "(torch.nn.Module or None expected)"
TypeError: cannot assign 'torch.FloatTensor' as child module 'output' (torch.nn.Module or None expected)
The text was updated successfully, but these errors were encountered:
thanks for suggesting this. I think this would be a good improvement (I'd favour the shorter backpack_output option). Would you be interested in setting up a PR?
Currently, hooks store values in
module.output
this causes an issue when using any model that uses.output
to store an nn.Module attribute. It's a very generic name that can collide with a variety of modules. As such, I cannot run backpack-for-pytorch on huggingface bert models. It would be better if the name was something more specific, even justbackpack_for_pytorch_output
or evenbackpack_output
to prevent collisions with attributes of the module.Creates an error similar:
The text was updated successfully, but these errors were encountered: