文章目录
- 1、Missing key(s) in state_dict: Unexpected key(s) in state_dict
- 2、CUDA out of memory.
- 3、wandb: / 0.124 MB of 0.124 MB uploaded (0.000 MB deduped)
- 4、no attribute “_free_weak_ref”和no attribute “getsize”
- 5、上级目录的编写方式
- 6、内核自动升级导致与驱动不适配
- 7、IsADirectoryError: [Errno 21] Is a directory: ‘.‘
- 8、`python xx.py(需要用到GPU)`执行命令后没反应
1、Missing key(s) in state_dict: Unexpected key(s) in state_dict
Missing key(s) in state_dict: Unexpected key(s) in state_dict 两种解决方法 祝你成功!!!
2、CUDA out of memory.
cuda out of memory(pytorch)问题的解决
3、wandb: / 0.124 MB of 0.124 MB uploaded (0.000 MB deduped)
Ctrl+C结束训练进程出现“wandb: / 0.124 MB of 0.124 MB uploaded (0.000 MB deduped)“解决方法:
4、no attribute “_free_weak_ref”和no attribute “getsize”
no attribute ‘_free_weak_ref‘和no attribute “getsize“的解决办法
这篇博客提供的一种解决方法是更新pytorch版本,但考虑到pytorch版本要与cuda、NIVIA DRIVER版本对应,调整起来比较麻烦且可能会导致其他更严重的问题,所以放弃这个思路。
5、上级目录的编写方式
import os
upper_dir=os.path.abspath(os.path.join(os.getcwd(), "../"))
6、内核自动升级导致与驱动不适配
3分钟解决报错NVIDIA_SMI has failed because it couldn’t communicate with the NVIDIA driver.
7、IsADirectoryError: [Errno 21] Is a directory: ‘.‘
报这个错是因为没有对应的文件或需要生成多级目录。项目中是因为在编写train.txt时后面多了几个空行,导致原本应该读入对应的png文件,变成了文件夹的path路径,导致报错。所以在编写数据集划分的txt时要注意回车,空格等字符的出现
8、python xx.py(需要用到GPU)
执行命令后没反应
发现是因为服务器的GPU1坏了,然后程序里需要用到GPU,所以导致它一直卡在那里没反应