接:
代码调试的坑:
在demo.py中,关于yaml.load(),由于版本升级安全性考虑,需要传入Loader=的位置参数
可用一下语句代替: yaml.safe_load(f)
def load_checkpoints(config_path, checkpoint_path, cpu=False):
with open(config_path) as f:
config = yaml.safe_load(f)
关于错误:
AssertionError: Torch not compiled with CUDA enableds
输入一下代码检查:
import torch
print(torch.__version__)
print(torch.cuda.is_available())
如果输出的结果是False,那么说明当前的Pytorch版本无法使用显卡。
查看CUDA版本信息:
nvcc --version
CUDA版本下载地址:
CUDA 工具包 | NVIDIA Developer
https://developer.nvidia.cn/zh-cn/cuda-toolkitCUDA Toolkit 11.6 Downloads | NVIDIA Developer
https://developer.nvidia.com/cuda-downloadsCUDA Toolkit Archive | NVIDIA DeveloperPrevious releases of the CUDA Toolkit, GPU Computing SDK, documentation and developer drivers can be found using the links below. Please select the release you want from the list below, and be sure to check www.nvidia.com/drivers for more recent production drivers appropriate for your hardware configuration.https://developer.nvidia.com/cuda-toolkit-archive
根据自己的CUDA版本在Pytorch官网查看并安装可用的版本,参考链接如下:
https://download.pytorch.org/whl/torch_stable.html
https://download.pytorch.org/whl/torch_stable.htmlhttps://download.pytorch.org/whl/cu102/torch_stable.html
https://download.pytorch.org/whl/cu102/torch_stable.html
PyTorch的下载,保证版本一致性
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch
本文介绍如何执行邮件服务器的DNS查询,并通过示例展示如何连接到SMTP服务器。此外,还详细介绍了在遇到PyTorch无法使用GPU的问题时的解决方法,包括如何检查CUDA环境及安装兼容版本的PyTorch。
https://blog.youkuaiyun.com/lm19770429/article/details/121842387
https://pytorch.org/get-started/locally/

被折叠的 条评论
为什么被折叠?



