1.Defaulting to user installation because normal site-packages is not writeable。
ERROR: Operation cancelled by user
已配置的文件无法修改,建议重新搭个环境,最快。
比如pytorch
https://download.pytorch.org/whl/torch_stable.html
下个torch稳定版
2.targets.cuda(async=True)
Syntax Error: invalid syntax:
修改为inputs, targets = inputs.cuda(), targets.cuda()即可
3.ModuleNotFoundError:No module named‘past’
解决方法安装future模块
4.No space left on device
需要手动清除文件特别是使用 nohup 命令时,所有的输出都会被不断地添加到同一个文件中,如果该进程不会自己终止,就可能导致输出文件占满整个磁盘。
还会出现下面的情况:明明已经安装的模块竟然找不到。
5.RuntimeError: expected device cuda:0 and dtype Float but got device cpu and dtype Float
loss = loss.cuda() 转化下类型,或者debug看看,有时是float,long,int比较灵活。
6.VSCode 更新失败的解决方法
https://blog.csdn.net/cjhxydream/article/details/107246909
7.Pytorch高版本(1.0)跑程序出现的几个错误
https://blog.csdn.net/bluehatihati/article/details/89154417
8.maven install 坑
https://blog.csdn.net/r1001020713/article/details/90106416?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-.control&dist_request_id=a324e51f-dd07-43c4-a7a9-338253981613&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.control
9.指定显卡
命令行用export CUDA_VISIBLE_DEVICES=1 #id可换成别的
不用在程序中写torch.cuda.set_device(‘cuda:’+str(gpu_ids))
这种写法的优先级低,如果model.cuda()中指定了参数,那么torch.cuda.set_device()会失效
10 torch与cuda不匹配问题
解决PyTorch与CUDA版本不匹配
https://blog.csdn.net/weixin_42069606/article/details/105198845?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.control&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-2.control