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

AttributeError: 'Hardswish' object has no attribute 'inplace' #33

Open
Syazaniwhd opened this issue Aug 18, 2022 · 0 comments
Open

AttributeError: 'Hardswish' object has no attribute 'inplace' #33

Syazaniwhd opened this issue Aug 18, 2022 · 0 comments

Comments

@Syazaniwhd
Copy link

(yolov5rbb) C:\Users\PC\Documents\UROPS\YOLOV5_RBB\rotation-yolov5>python detect.py --weights yolov5s.pt --source data/images/carpark2.jpg
Namespace(weights=['yolov5s.pt'], source='data/images/carpark2.jpg', output='inference/output', img_size=1024, conf_thres=0.4, iou_thres=0.5, device='', view_img=False, save_txt=False, classes=None, agnostic_nms=False, augment=False, update=False)
Using CPU

Fusing layers...
Model Summary: 140 layers, 7.45958e+06 parameters, 0 gradients
image 1/1 C:\Users\PC\Documents\UROPS\YOLOV5_RBB\rotation-yolov5\data\images\carpark2.jpg: Traceback (most recent call last):
File "C:\Users\PC\Documents\UROPS\YOLOV5_RBB\rotation-yolov5\detect.py", line 174, in
detect()
File "C:\Users\PC\Documents\UROPS\YOLOV5_RBB\rotation-yolov5\detect.py", line 75, in detect
pred = model(img, augment=opt.augment)[0]
File "C:\Users\PC\anaconda3\envs\yolov5rbb\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users\PC\Documents\UROPS\YOLOV5_RBB\rotation-yolov5\models\yolo.py", line 116, in forward
return self.forward_once(x, profile) # single-scale inference, train
File "C:\Users\PC\Documents\UROPS\YOLOV5_RBB\rotation-yolov5\models\yolo.py", line 136, in forward_once
x = m(x) # run
File "C:\Users\PC\anaconda3\envs\yolov5rbb\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users\PC\Documents\UROPS\YOLOV5_RBB\rotation-yolov5\models\common.py", line 89, in forward
return self.conv(torch.cat([x[..., ::2, ::2], x[..., 1::2, ::2], x[..., ::2, 1::2], x[..., 1::2, 1::2]], 1))
File "C:\Users\PC\anaconda3\envs\yolov5rbb\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users\PC\Documents\UROPS\YOLOV5_RBB\rotation-yolov5\models\common.py", line 33, in fuseforward
return self.act(self.conv(x))
File "C:\Users\PC\anaconda3\envs\yolov5rbb\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "C:\Users\PC\anaconda3\envs\yolov5rbb\lib\site-packages\torch\nn\modules\activation.py", line 472, in forward
return F.hardswish(input, self.inplace)
File "C:\Users\PC\anaconda3\envs\yolov5rbb\lib\site-packages\torch\nn\modules\module.py", line 1207, in getattr
raise AttributeError("'{}' object has no attribute '{}'".format(
AttributeError: 'Hardswish' object has no attribute 'inplace'

How do I resolve the hardwish error

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

No branches or pull requests

1 participant