AttributeError: 'Upsample' object has no attribute 'recompute_scale_factor'

## python error

(a1) [root@localhost Autonomous-Vehicle-Environment-Perception]# python main.py --video test.mov Yolo model loaded! CULane model loaded! Downloading: "https://download.pytorch.org/models/resnet18-f37072fd.pth" to /root/.cache/torch/hub/checkpoints/resnet18-f37072fd.pth 100%|████████████████████████████████████████████████████████████████████████████████████| 44.7M/44.7M [00:00<00:00, 70.5MB/s] SGD model loaded! Sign Detection model loaded! resize False rotate False Traceback (most recent call last): File "main.py", line 101, in <module> yoloOutput = detector.detect(frame) File "/root/yolo/Autonomous-Vehicle-Environment-Perception/elements/yolo.py", line 46, in detect pred = self.yolo_model(img, augment=False)[0] File "/root/anaconda3/envs/a1/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl return forward_call(*input, **kwargs) File "/root/yolo/Autonomous-Vehicle-Environment-Perception/./yolov5/models/yolo.py", line 127, in forward return self.forward_once(x, profile) # single-scale inference, train File "/root/yolo/Autonomous-Vehicle-Environment-Perception/./yolov5/models/yolo.py", line 143, in forward_once x = m(x) # run File "/root/anaconda3/envs/a1/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl return forward_call(*input, **kwargs) File "/root/anaconda3/envs/a1/lib/python3.8/site-packages/torch/nn/modules/upsampling.py", line 154, in forward recompute_scale_factor=self.recompute_scale_factor) File "/root/anaconda3/envs/a1/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1185, in __getattr__ raise AttributeError("'{}' object has no attribute '{}'".format( AttributeError: 'Upsample' object has no attribute 'recompute_scale_factor'

## fix error

from

(a1) [root@localhost Autonomous-Vehicle-Environment-Perception]# cat requirements.txt # pip install -r requirements.txt # base ---------------------------------------- Cython matplotlib>=3.2.2 numpy>=1.18.5 opencv-python>=4.1.2 Pillow PyYAML>=5.3 scipy>=1.4.1 torch>=1.7.0 torchvision>=0.8.0 tqdm>=4.41.0 seaborn pandas

to-->>

(a1) [root@localhost Autonomous-Vehicle-Environment-Perception]# cat requirements.txt # pip install -r requirements.txt # base ---------------------------------------- Cython matplotlib>=3.2.2 numpy>=1.18.5 opencv-python>=4.1.2 Pillow PyYAML>=5.3 scipy>=1.4.1 torch>=1.7.0 torchvision>=0.8.0 tqdm>=4.41.0 seaborn pandas



 





댓글

이 블로그의 인기 게시물

[!] CDN: trunk URL couldn't be downloaded: https://cdn.cocoapods.org/CocoaPods-version.yml Response: URL using bad/illegal format or missing URL

starcraft map

Data Analysis with Superset - boardless chart