Open MaximeDeloche opened 10 months ago
Sory for the very slow response, could modify the model after creating
def clear_inplace(module):
res = module
if hasattr(module, 'inplace'):
module.inplace = False
else:
for name, child in module.named_children():
new_child = clear_inplace(child)
return res
Hi,
I face an issue while trying to add backward hooks to a model that includes a BiFPN (to generate some gradient plots). I get the following error when calling the forward of my
BiFpn
object:Here's a sample that reproduces the error:
I tracked it down to the following line, where the
torch.nn.ReLU6
is created withinplace=True
. Switching that toFalse
fixes the error.https://github.com/rwightman/efficientdet-pytorch/blob/d43c9e34cd62d22b4205831bb735f6dd83b8e881/effdet/efficientdet.py#L381
Is it for performance that these operations are created in place? Does someone see a fix for that issue, besides creating these activations with
inplace=False
?Thanks in advance 👍