Closed
Description
🚀 Feature
Several detection models make use of an attribute _has_warned
which was originally used by JIT to avoid throwing the same warning multiple times:
vision/torchvision/models/detection/retinanet.py
Lines 373 to 374 in 9778d26
vision/torchvision/models/detection/retinanet.py
Lines 554 to 556 in 9778d26
JIT should now be able to handle this automatically without the need of this variable. Thus we should remove the specific variable and confirm that calling forward multiple times on a JIT-scripted model produces a single warning. If that's indeed the case, we can remove it from all places:
- RetinaNet
- GeneralizedRCNN
- SSD (pending merge at Add SSD architecture with VGG16 backbone #3403)