WindVChen / DRENet

The official implementation of DRENet (Degraded Reconstruction Enhancement Network) for tiny ship detection in remote sensing Images
GNU General Public License v3.0
43 stars 6 forks source link

Cannot run detect.py #7

Open tommylatranvu opened 1 year ago

tommylatranvu commented 1 year ago

Hello Chen, I tried your code detect.py, but I always had a problem. Could you check it for me please! Thanks a lot!

(optic_ship) la@erin-tla-30122:~/Desktop/DRENet_ship$ python detect.py --weights "./DRENet.pt" --source "images/" --device cpu Namespace(agnostic_nms=False, augment=False, classes=None, conf_thres=0.25, device='cpu', exist_ok=False, img_size=512, iou_thres=0.45, name='exp', project='runs/detect', save_conf=False, save_txt=False, source='images/', update=False, view_img=False, weights=['./DRENet.pt']) YOLOv5 torch 1.13.1+cu117 CPU

Fusing layers... Model Summary: 239 layers, 4788248 parameters, 0 gradients image 1/1 /home/la/Desktop/DRENet_ship/images/GF1_WFV4_E124.3_N33.5_20200926_L1A0005089385_3584_8192.png: Traceback (most recent call last): File "detect.py", line 175, in detect() File "detect.py", line 72, in detect pred = model(img, augment=opt.augment)[0][0] File "/opt/anaconda3/envs/optic_ship/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(*input, *kwargs) File "/home/la/Desktop/DRENet_ship/models/yolo.py", line 131, in forward return self.forward_once(x, profile) # single-scale inference, train File "/home/la/Desktop/DRENet_ship/models/yolo.py", line 148, in forward_once x = m(x) # run File "/opt/anaconda3/envs/optic_ship/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl return forward_call(input, **kwargs) File "/opt/anaconda3/envs/optic_ship/lib/python3.7/site-packages/torch/nn/modules/upsampling.py", line 157, in forward recompute_scale_factor=self.recompute_scale_factor) File "/opt/anaconda3/envs/optic_ship/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1270, in getattr type(self).name, name)) AttributeError: 'Upsample' object has no attribute 'recompute_scale_factor'

WindVChen commented 1 year ago

Hi @tommylatranvu,

I think this may help https://github.com/WindVChen/DRENet/issues/4#issuecomment-1255846664.

tommylatranvu commented 1 year ago

Hi Chen, The error was solved. Thanks a lot for your help! You are doing a great work.