FutureWarning: `torch.cuda.amp.custom_bwd(args...)` is deprecated. Please use `torch.amp.custom_bwd(

Bench2Drive github:https://github.com/Thinklab-SJTU/Bench2Drive

Bench2DriveZoo github:https://github.com/Thinklab-SJTU/Bench2DriveZoo

在复现Bench2Drive的时候遇到的问题,显示

FutureWarning: `torch.cuda.amp.custom_fwd(args...)` is deprecated. Please use `torch.amp.custom_fwd(args..., device_type='cuda')` instead.

当前环境中安装的torch版本是2.4.0,找了半天原因,终于在github的一个issue下面找到了原因。

原因:

        torch从2.4及以后便不再支持`torch.cuda.amp.custom_fwd(args...)`

解决方法:

        将torch版本降级为2.3,torchvision版本也需要相应降低。

        版本对应参考这里:https://github.com/pytorch/vision#installation

        我用的版本是这样的:

pip install torch==2.3.1+cu118 torchvision==0.18.1+cu118 torchaudio -f https://download.pytorch.org/whl/torch_stable.html

        这之后问题及基本就解决了。

补充:

        建议在配置环境的时候就早些修改,如果安装完了建议把一些模块比如mmcv--0.01卸了再重新“pip install -v -e.”。否则,有些依赖改起来很费劲。

参考来源:

https://github.com/Ikaros-521/AI-Vtuber/issues/940

  • 4
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值