pytorch的ModuleNotFoundError: No module named 'torch'
程序员文章站
2022-05-28 22:27:11
...
我的问题是python安装版本和torch的版本不对应问题
pytorch 0.3.1 py36_cuda9.0.176_cudnn7.0.5_2 [cuda90] pytorch
python 3.7.3 h0371630_0
在conda中对python的版本进行指定的修改,将3.7版本将为3.6版本
conda update python=3.6
Python 3.6.8 |Anaconda, Inc.| (default, Dec 30 2018, 01:22:34)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> exit()
总之,torch还是tensorflow都是和python有版本的对应关系的,新手都应该注意。
推荐阅读
-
解决Python找不到ssl模块问题 No module named _ssl的方法
-
python提示No module named images的解决方法
-
解决Python源码编译时提示:ModuleNotFoundError: No module named ‘distutils.command‘
-
巨坑总结:ModuleNotFoundError: No module named ‘tools‘引发的一系列问题
-
下载python中Crypto库报错:ModuleNotFoundError: No module named ‘Crypto’的解决
-
解决python "No module named pip"的问题
-
解决Python找不到ssl模块问题 No module named _ssl的方法
-
解决方法:在Python中使用Win32api报错的问题,No module named win32api
-
pycharm运行出现ImportError:No module named的解决方法
-
PyTorch中设置学习率衰减的方法/torch.optim.lr_scheduler/learning_rate_decay