在kaggle上安装对应版本的pytorch CUDA

1.最近用kaggle复现别人的程序,在train时报错:

opt/conda/lib/python3.10/site-packages/torch/optim/lr_scheduler.py:139: UserWarning: Detected call of `lr_scheduler.step()` before `optimizer.step()`. In PyTorch 1.1.0 and later, you should call them in the opposite order: `optimizer.step()` before `lr_scheduler.step()`.  Failure to do this will result in PyTorch skipping the first value of the learning rate schedule. See more details at torch.optim — PyTorch 2.1 documentation
  warnings.warn("Detected call of `lr_scheduler.step()` before `optimizer.step()`. "

显示大致意思是torch/optim/lr_scheduler.py文件中 应将optimizer.step()在lr_scheduler.step()前调用,这是应为torch版本不对应,搜了半天,大都说最简单的方法是重新安装torch和CUDA。

可在kaggle 安装时又遇到了麻烦!!!

!conda create -n pytorch1 python=3.7
!conda activate pytorch1
!conda install pytorch=1.1 torchvision=0.3 cudatoolkit=9.0 -c pytorch
!pip install matplotlib scikit-image opencv-python yacs joblib natsort h5py tqdm

然后它一直在saving  evenment 打转,换成镜像源也很慢 怎么搞得,那位大佬教教我这个菜鸡!!

  • 9
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值