安装pytorch https://pytorch.org/get-started/locally/官网进行选择 注意选用pip安装,对应命令后的网页链接为安装源,可以网页打开看里面torch的各种版本,一般会根据环境的条件装允许的最高版本 有时虽然选定Pytorch为最高稳定版1.12,但实际安装的却是1.10,导致运行代码时警告算力不匹配, 例如:NVIDIA GeForce RTX 3090 with CUDA capability sm_86 is not compatible with the current PyTorch installation. The current PyTorch install supports CUDA capabilities sm_37 sm_50 sm_60 sm_70. 实际可能是因为环境的python3.6版本过低,当查看前面的网页链接源可以看到py36最多能装1.10的torch, 因此应该提高python版本