Closed dongxiaolong closed 2 years ago
change models/experimental.py line 124
for m in model.modules():
if type(m) in [nn.Hardswish, nn.LeakyReLU, nn.ReLU, nn.ReLU6, nn.SiLU, Detect, Model]:
m.inplace = inplace # pytorch 1.7.0 compatibility
elif type(m) is Conv:
m._non_persistent_buffers_set = set() # pytorch 1.6.0 compatibility
elif type(m) is nn.Upsample and not hasattr(m, 'recompute_scale_factor'):
m.recompute_scale_factor = None
Traceback (most recent call last): File "export.py", line 71, in <module> y = model(img) # dry runs File "/home/dong/.conda/envs/yolo-pose/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl return forward_call(*input, **kwargs) File "/home/dong/Code/yolo-pose/edgeai-yolov5-yolo-pose/models/yolo.py", line 157, in forward return self.forward_once(x, profile) # single-scale inference, train File "/home/dong/Code/yolo-pose/edgeai-yolov5-yolo-pose/models/yolo.py", line 188, in forward_once x = m(x) # run File "/home/dong/.conda/envs/yolo-pose/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl return forward_call(*input, **kwargs) File "/home/dong/.conda/envs/yolo-pose/lib/python3.8/site-packages/torch/nn/modules/upsampling.py", line 154, in forward recompute_scale_factor=self.recompute_scale_factor) File "/home/dong/.conda/envs/yolo-pose/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1185, in __getattr__ raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'Upsample' object has no attribute 'recompute_scale_factor'