Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: run python export.py #21

Closed
dongxiaolong opened this issue Jun 8, 2022 · 2 comments
Closed

error: run python export.py #21

dongxiaolong opened this issue Jun 8, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@dongxiaolong
Copy link

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'

@dongxiaolong dongxiaolong added the bug Something isn't working label Jun 8, 2022
@dongxiaolong
Copy link
Author

fix the bug by:
ultralytics#6948 (comment)

@kadimakipp
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants