Closed dsuess closed 2 months ago
Hmm, I guess I forgot to add the final annotation on that return_dict bool, that should fix it without needing different classes. I'm away from computer for a few days, you can try that and PR welcome, otherwise will do this weekend. You can find other examples, eg use_fused_attn https://github.com/huggingface/pytorch-image-models/blob/d4ef0b4d589c9b0cb1d6240ff373c5508dbb8023/timm/layers/attention2d.py#L93
Thanks for the quick reply! I didn't know about Final
. Let me create a PR.
Describe the bug
The recent addition of the
return_dict
option toFeatureGraphNet
andGraphExtractNet
breaks jit-scripting models with feature extraction.To Reproduce Steps to reproduce the behavior:
breaks with the following error message:
Expected behavior
Models with feature extraction turned on are still script-able.
Desktop (please complete the following information):
1.0.7
Additional context
A simple fix would be to have different classes for
return_dict=True
andFalse
, which only have a single, fixed return type.