pytorch-lightning踩坑记录

pytorch-lightning==1.5.10,python3.7,torch==1.10.0

20220421

1

module 'torchmetrics' has no attribute 'F1'

改成:

torchmetrics.F1Score()

 2

You have asked for `amp_level='O2'` but it's only supported with `amp_backend='apex'

尝试添加amp_backend: apex到Trainer里,出现:

You have asked for Apex AMP but you have not installed it. Install `apex` using this guide: https://github.com/NVIDIA/apex

参考这条安装:安装apex

根据官方文档

  • amp_level (Optional[str]) – The optimization level to use (O1, O2, etc…). By default it will be set to “O2” if amp_backend is set to “apex”.

expected scalar type Float but found Half

 输出数据类型是torch.float32明明!

跑不下去了,先放个坑

20220430

猜测是显卡不能跑混合精度,改成precision=32,可以正常运行了

20220712

--gpus=    (有几个卡就写几,要指定卡的话可以在前面加上CUDA_VISIBLE_DEVICES=0,1..指定0和1两个卡,gpus=2

评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值