File "/opt/conda/envs/alpha_env/lib/python3.8/site-packages/torch/jit/_recursive.py", line 368, in create_methods_and_properties_from_stubs
concrete_type._create_methods_and_properties(property_defs, property_rcbs, method_defs, method_rcbs, method_defaults)
RuntimeError:
Module 'ResNet' has no attribute 'stages_and_names' (This attribute exists on the Python module, but we failed to convert Python type: 'list' to a TorchScript type. Could not infer type of list element: Cannot infer concrete type of torch.nn.Module. Its type was inferred; try adding a type annotation for the attribute.):
File "/root/code/modeling/backbone/res2net.py", line 632
if "stem" in self._out_features:
outputs["stem"] = x
for stage, name in self.stages_and_names:
~~~~~~~~~~~~~~~~~~~~~ <--- HERE
x = stage(x)
if name in self._out_features:
Instructions To Reproduce the 🐛 Bug:
ref https://github.com/facebookresearch/detectron2/issues/2734 not work !!!
Environment:
torch 1.10.2+cu113
detectron2 0.6