BossZard / rotation-yolov5

rotation detection based on yolov5
GNU General Public License v3.0
377 stars 97 forks source link

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

Open Syazaniwhd opened 1 year ago

Syazaniwhd commented 1 year ago

(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