yolov7
yolov7 copied to clipboard
'Upsample' object has no attribute 'recompute_scale_factor'
AttributeError: 'Upsample' object has no attribute 'recompute_scale_factor'
This is cause by different version of pytorch. solution
非常惊喜和意外能收到老师用邮件回复我在github提的问题,按照您提示的方法更换pytorch版本后已经可以运行正常yolov7。 此刻心情激动的心情,千里之外一句谢谢希望能收到。
Re:Re: [WongKinYiu/yolov7] 'Upsample' object has no attribute 'recompute_scale_factor' (Isxisue #520)
At 2022-08-16 15:52:50, "Kin-Yiu, Wong" @.***> wrote:
This is cause by different version of pytorch. solution
—7 Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
This is cause by different version of pytorch. solution
The solution is empty now, my torch version is 1.12.0 + cu10.2, need i downgrade my torch?
https://github.com/WongKinYiu/yolov7/blob/main/models/experimental.py#L249-L250 https://github.com/WongKinYiu/yolov7/blob/u5/models/yolo.py#L224-L226
for those who have this problem, you can follow this https://github.com/ultralytics/yolov5/issues/6948#issuecomment-1075548218
@WongKinYiu Looking at the experimental.py in 249 it says # torch 1.11.0 compatibility. What about for torch 1.12.1 which is the latest version on pytorch.
I downgraded my pytorch version to 1.11.0 but still faced this error, I downgraded pytorch to 1.10.1 and it solved the error. I used this command specifically: "conda install pytorch==1.10.1 torchvision==0.11.2 torchaudio==0.10.1 cudatoolkit=11.3 -c pytorch -c conda-forge"
The issue is solved temporarily by downgrading PyTorch to 1.10.1 as @afzixhaikh mentioned above.