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

Imported warnings in common.py #259

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DragonflyRobotics
Copy link

There was an error: "NameError: name 'warnings' is not defined". The solution was to simply import the module.

Reproduce steps:

  1. python3 export.py --weights ./weights/yolov5s.pt --img 640 --batch 1
Namespace(batch_size=1, dynamic=False, fp16_trt=False, img_size=[640, 640], onnx2pb=False, onnx2trt=False, onnx_infer=True, weights='./weights/yolov5s.pt')
Fusing layers... 
Model Summary: 213 layers, 7225885 parameters, 0 gradients
Traceback (most recent call last):
  File "export.py", line 72, in <module>
    y = model(img)  # dry run
  File "/home/b4d/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/b4d/Documents/CMON/yolov5-face/models/yolo.py", line 180, in forward
    return self.forward_once(x, profile)  # single-scale inference, train
  File "/home/b4d/Documents/CMON/yolov5-face/models/yolo.py", line 196, in forward_once
    x = m(x)  # run
  File "/home/b4d/.local/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/b4d/Documents/CMON/yolov5-face/models/common.py", line 252, in forward
    with warnings.catch_warnings():
NameError: name 'warnings' is not defined

There was an error: "NameError: name 'warnings' is not defined". The solution was to simply import the module.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant