ImportError: No module named torchvision

Candy_GL發表於2018-07-27

轉自:https://blog.csdn.net/miao0967020148/article/details/80400536

torchvison:圖片、視訊資料和深度學習模型

解決方案

安裝torchvision,參照官網

 

pip install torchvision

安裝指定版本

pip install torchvision==0.1.8 


Collecting torchvision
  Downloading https://files.pythonhosted.org/packages/ca/0d/f00b2885711e08bd71242ebe7b96561e6f6d01fdb4b9dcf4d37e2e13c5e1/torchvision-0.2.1-py2.py3-none-any.whl (54kB)
    100% |████████████████████████████████| 61kB 68kB/s 
Collecting pillow>=4.1.1 (from torchvision)
  Using cached https://files.pythonhosted.org/packages/00/49/a0483e7308b4b04b5a898789911dbb876d9fea54e7df0453915e47744cfd/Pillow-5.1.0-cp27-cp27mu-manylinux1_x86_64.whl
Requirement already satisfied: torch in /home/miao/deep_ocr_env/lib/python2.7/site-packages (from torchvision) (0.3.0.post4)
Requirement already satisfied: six in /home/miao/deep_ocr_env/lib/python2.7/site-packages (from torchvision) (1.11.0)
Requirement already satisfied: numpy in /home/miao/deep_ocr_env/lib/python2.7/site-packages (from torchvision) (1.12.1)
Requirement already satisfied: pyyaml in /home/miao/deep_ocr_env/lib/python2.7/site-packages (from torch->torchvision) (3.12)
Installing collected packages: pillow, torchvision
  Found existing installation: Pillow 4.1.0
    Uninstalling Pillow-4.1.0:
      Successfully uninstalled Pillow-4.1.0
Successfully installed pillow-5.1.0 torchvision-0.2.1

相關文章