icey-zhang / SuperYOLO

SuperYOLO is accepted by TGRS
323 stars 54 forks source link

AttributeError: 'Model' object has no attribute 'steam' #106

Closed Mengxianhong closed 6 months ago

Mengxianhong commented 6 months ago

运行test.py报错:请问如何解决呢 Namespace(weights='runs/train/exp-best/weights/best.pt', data='data/SRvedai.yaml', batch_size=1, img_size=512, input_mode='RGB+IR+fusion', conf_thres=0.001, iou_thres=0.6, task='val', device='0', single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=False, project='runs/test', name='exp', exist_ok=False) YOLOv5 2024-4-3 torch 1.12.1 CUDA:0 (NVIDIA GeForce RTX 3060 Laptop GPU, 6143.5MB)

Fusing layers... C:\software\anaconda\envs\my_torch\lib\site-packages\torch\functional.py:478: UserWarning: torch.meshgrid: in an upcoming release, it will be required to pass the indexing argument. (Triggered internally at C:\cb\pytorch_1000000000000\work\aten\src\ATen\native\TensorShape.cpp:2895.) return _VF.meshgrid(tensors, *kwargs) # type: ignore[attr-defined] Model Summary: 187 layers, 4845133 parameters, 0 gradients, 56.0 GFLOPS SRyolo_MF.yaml val: Scanning 'dataset\VEDAI\labels.cache' for images and labels... 121 found, 0 missing, 2 empty, 0 corrupted: 100%|██████████| 121/121 [00:00<?, ?it/s] Class Images Labels P R mAP@.5 mAP@.5:.95: 0%| | 0/121 [00:00<?, ?it/s] Traceback (most recent call last): File "D:\C8=python_work\C9.4=life\11=multimodal\02=code\SuperYOLO-main\test.py", line 137, in val out, train_out = model(img,ir,input_mode=input_mode) #zjq inference and training outputs File "C:\software\anaconda\envs\my_torch\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl return forward_call(input, **kwargs) File "D:\C8=python_work\C9.4=life\11=multimodal\02=code\SuperYOLO-main\models\SRyolo.py", line 173, in forward steam1 = self.forward_once(x,'steam',profile) File "D:\C8=python_work\C9.4=life\11=multimodal\02=code\SuperYOLO-main\models\SRyolo.py", line 205, in forward_once for m in self.steam: File "C:\software\anaconda\envs\my_torch\lib\site-packages\torch\nn\modules\module.py", line 1207, in getattr raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'Model' object has no attribute 'steam'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\C8=python_work\C9.4=life\11=multimodal\02=code\SuperYOLO-main\test.py", line 374, in val(opt.data, File "D:\C8=python_work\C9.4=life\11=multimodal\02=code\SuperYOLO-main\test.py", line 139, in val out, trainout, = model(img,ir,input_mode=input_mode) #zjq inference and training outputs File "C:\software\anaconda\envs\my_torch\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "D:\C8=python_work\C9.4=life\11=multimodal\02=code\SuperYOLO-main\models\SRyolo.py", line 173, in forward steam1 = self.forward_once(x,'steam',profile) File "D:\C8=python_work\C9.4=life\11=multimodal\02=code\SuperYOLO-main\models\SRyolo.py", line 205, in forward_once for m in self.steam: File "C:\software\anaconda\envs\my_torch\lib\site-packages\torch\nn\modules\module.py", line 1207, in getattr raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'Model' object has no attribute 'steam'