[resolved] PySlice_AdjustIndices Error

That is weird, i’ll look into this. In the meanwhile, install directly from wheel file (see instructions on http://pytorch.org )

I’ve got the same problem as you. I’ve solved it by switching to python3.5 and everything works now.

Thanks your advice! By switching to 3.5, everything works now too.

i also have this problem:

ImportError: /opt/anaconda3/lib/python3.6/site-packages/PIL/_imaging.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PySlice_Unpack

(/opt/anaconda3) root@user:/opt/anaconda3/bin# ./conda list | grep pytorch
pytorch 0.1.11 py360_4cu80 [cuda80] soumith

(/opt/anaconda3) root@user:/opt/anaconda3/bin# ./python --version
Python 3.6.0 :: Anaconda custom (64-bit)

this is now fixed. Latest 0.1.12 binaries will not have this downgrade issue. They’re available on conda now.

for my case, the latest 0.1.12 binaries doesn’t seem to work.

my update command:
conda uninstall pytorch
conda install pytorch torchvision -c soumith

After which I have the followings:
(/opt/anaconda3) root@user:/opt/anaconda3/bin# python --version
Python 3.6.0 :: Anaconda custom (64-bit)

(/opt/anaconda3) root@user:/opt/anaconda3/bin# conda list | grep pytorch
pytorch 0.1.12 py360_1cu80 [cuda80] soumith

in python console:
Python 3.6.0 |Anaconda custom (64-bit)| (default, Dec 23 2016, 12:22:00)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
import torch
torch.version
’0.1.11+27fb875’

my error message is

import torchvision.transforms as transforms
File “/opt/anaconda3/lib/python3.6/site-packages/torchvision-0.1.8-py3.6.egg/torchvision/init.py”, line 2, in
File “/opt/anaconda3/lib/python3.6/site-packages/torchvision-0.1.8-py3.6.egg/torchvision/datasets/init.py”, line 1, in
File “/opt/anaconda3/lib/python3.6/site-packages/torchvision-0.1.8-py3.6.egg/torchvision/datasets/lsun.py”, line 2, in
File “/opt/anaconda3/lib/python3.6/site-packages/PIL/Image.py”, line 56, in
from . import _imaging as core
ImportError: /opt/anaconda3/lib/python3.6/site-packages/PIL/_imaging.cpython-36m-x86_64-linux-gnu.so: undefined symbol: PySlice_Unpack

@Hengck please do:

conda uninstall pillow
conda install pillow

It does not work.
Since I can temporary resolved this issue by using anaconda 3.5, I will wait and see if of others have the same issue. Thanks for the help!

Btw, here is the version of pillow after uninstall and install:

root@user:/opt/anaconda3/bin# ./conda list | grep pillow
pillow 4.1.0 py36_0

in python:
Python 3.6.0 |Anaconda custom (64-bit)| (default, Dec 23 2016, 12:22:00)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
PIL.version
’4.1.0’

Same problem as @Hengck here. None of the solutions above worked. I finally solved it by uninstalling anaconda at all and then install pytorch:

conda install pytorch torchvision cuda80 -c soumith

By the way @Soumith_Chintala, I can still reproduce this issue: first installed anaconda, then install pytorch, then uninstall & install pillow, then install torchvision

conda install pytorch torchvision cuda80 -c soumith
conda uninstall pillow
conda install pillow
conda install torchvision -c soumith

seems the problem is caused by pillow, pillow 4.0.0-py36_0 is required instead of the most up-to-date 4.1.0-py36_0

see my previous post which seems to be censored :frowning:

related to this issue: https://github.com/pytorch/vision/issues/151

I confirmed that uprading to pillow 4.1.1 solves my issue with anaconda 3.6.
Thanks!

conda uninstall -y torchvision pillow
pip install pillow==4.1.1 torchvision

2 Likes

Looks like this problem is back after updating pytorch version to 0.2 for 8.0 cuda, python 3.6.
Any suggestions?

For a quick fix, you might want to update python from version 3.6.0 to python3.6.1. For example, if you were using Anaconda, you can simply try

conda install python=3.6.1
1 Like