2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Python PyTorch install tips

Last updated at Posted at 2017-04-18

このエラーにピンときたらPyTorch Forumsへ...

import torchvision.transforms as transforms
Traceback (most recent call last):
File "", line 1, in
File "/home/hogehoge/anaconda3/envs/py36/lib/python3.6/site-packages/torchvision-0.1.8-py3.6.egg/torchvision/init.py", line 2, in
File "/home/hogehoge/anaconda3/envs/py36/lib/python3.6/site-packages/torchvision-0.1.8-py3.6.egg/torchvision/datasets/init.py", line 1, in
File "/home/hogehoge/anaconda3/envs/py36/lib/python3.6/site-packages/torchvision-0.1.8-py3.6.egg/torchvision/datasets/lsun.py", line 2, in
File "/home/hogehoge/anaconda3/envs/py36/lib/python3.6/site-packages/PIL/Image.py", line 56, in
from . import _imaging as core
ImportError: /home/hogehoge/anaconda3/envs/py36/lib/python3.6/site-packages/PIL/_imaging.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PySlice_Unpack

とまあ,このエラーで長いこと苦しめられました.
私の環境は 
python 3.6
conda install pytorch torchvision -c soumith
で作成.

解決法はpython 3.5 に変えること.以上

$ conda create -n py35 python=3.5
$ conda activate py35
(py35)$ conda install pytorch torchvision -c soumith

で,とりあえずうまく行きます.以上

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?