# \[resolved\] PySlice\_AdjustIndices Error

**URL:** <https://discuss.pytorch.org/t/resolved-pyslice-adjustindices-error/1475>\
**Category:** Uncategorized\
**Created:** [March 30, 2017, 4:26am UTC](https://discuss.pytorch.org/t/resolved-pyslice-adjustindices-error/1475 "2017-03-30T04:26:22Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seungyoung\_Park](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/seungyoung_park/32/48889_2.png) [@Seungyoung\_Park](https://discuss.pytorch.org/u/Seungyoung_Park)\
**Post date:** [March 30, 2017, 4:26am UTC](https://discuss.pytorch.org/t/resolved-pyslice-adjustindices-error/1475/1 "2017-03-30T04:26:23Z")

</div>

I am using python 3.6 on Ubuntu 16.04.

I have just updated pytorch via conda.

But, I got an following error when torch was imported.

Python 3.6.0 |Anaconda 4.3.1 (64-bit)| (default, Dec 23 2016, 12:22:00)  
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux  
Type “help”, “copyright”, “credits” or “license” for more information.

> > > import torch  
> > > Traceback (most recent call last):  
> > > File “”, line 1, in   
> > > File “/home/sypark/anaconda3/lib/python3.6/site-packages/torch/ **init**.py”, line 53, in   
> > > from torch.\_C import \*  
> > > ImportError: /home/sypark/anaconda3/lib/python3.6/site-packages/torch/\_C.cpython-36m-x86\_64-linux-gnu.so: undefined symbol: PySlice\_AdjustIndices

Please help me how to solve this problem.

---

<div class="post-metadata">

**Author:** ![smth](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/smth/32/13_2.png) [@smth](https://discuss.pytorch.org/u/smth)\
**Post date:** [March 30, 2017, 5:31am UTC](https://discuss.pytorch.org/t/resolved-pyslice-adjustindices-error/1475/2 "2017-03-30T05:31:30Z")

</div>

this makes no sense yet, because python 3.6 should be having that. Let’s try to figure this out.

Can you please paste your output of the following command:

```auto
ldd /home/sypark/anaconda3/lib/python3.6/site-packages/torch/_C.cpython-36m-x86_64-linux-gnu.so

```

---

<div class="post-metadata">

**Author:** ![Seungyoung\_Park](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/seungyoung_park/32/48889_2.png) [@Seungyoung\_Park](https://discuss.pytorch.org/u/Seungyoung_Park)\
**Post date:** [March 30, 2017, 5:35am UTC](https://discuss.pytorch.org/t/resolved-pyslice-adjustindices-error/1475/3 "2017-03-30T05:35:15Z")

</div>

I downgraded pytorch to 0.1.10. Then, there is no problem.  
Also, I found the same question on

> <https://stackoverflow.com/questions/43104252/undefined-symbol-pyslice-adjustindices-when-importing-pytorch>

He had the same problem.

The output is below.

linux-vdso.so.1 =\> (0x00007ffc94684000)  
libshm.so =\> /home/sypark/anaconda3/lib/python3.6/site-packages/torch/lib/libshm.so (0x00007f9936bfa000)  
libcudart.so.8.0 =\> /home/sypark/anaconda3/lib/python3.6/site-packages/torch/lib/libcudart.so.8.0 (0x00007f9936991000)  
libcudnn.so.5 =\> /home/sypark/anaconda3/lib/python3.6/site-packages/torch/lib/libcudnn.so.5 (0x00007f9931bbb000)  
libpython3.6m.so.1.0 =\> /home/sypark/anaconda3/lib/python3.6/site-packages/torch/…/…/…/libpython3.6m.so.1.0 (0x00007f99316b6000)  
libTH.so.1 =\> /home/sypark/anaconda3/lib/python3.6/site-packages/torch/lib/libTH.so.1 (0x00007f9931106000)  
libTHS.so.1 =\> /home/sypark/anaconda3/lib/python3.6/site-packages/torch/lib/libTHS.so.1 (0x00007f9930ed3000)  
libTHPP.so.1 =\> /home/sypark/anaconda3/lib/python3.6/site-packages/torch/lib/libTHPP.so.1 (0x00007f9930b05000)  
libTHNN.so.1 =\> /home/sypark/anaconda3/lib/python3.6/site-packages/torch/lib/libTHNN.so.1 (0x00007f9930800000)  
libTHC.so.1 =\> /home/sypark/anaconda3/lib/python3.6/site-packages/torch/lib/libTHC.so.1 (0x00007f9922a49000)  
libTHCS.so.1 =\> /home/sypark/anaconda3/lib/python3.6/site-packages/torch/lib/libTHCS.so.1 (0x00007f992282f000)  
libTHCUNN.so.1 =\> /home/sypark/anaconda3/lib/python3.6/site-packages/torch/lib/libTHCUNN.so.1 (0x00007f991694d000)  
libgcc\_s.so.1 =\> /home/sypark/anaconda3/lib/python3.6/site-packages/torch/…/…/…/libgcc\_s.so.1 (0x00007f9916737000)  
libpthread.so.0 =\> /lib/x86\_64-linux-gnu/libpthread.so.0 (0x00007f99164fe000)  
libc.so.6 =\> /lib/x86\_64-linux-gnu/libc.so.6 (0x00007f9916134000)  
librt.so.1 =\> /lib/x86\_64-linux-gnu/librt.so.1 (0x00007f9915f2c000)  
libm.so.6 =\> /lib/x86\_64-linux-gnu/libm.so.6 (0x00007f9915c22000)  
/lib64/ld-linux-x86-64.so.2 (0x000055f3b1b3f000)  
libdl.so.2 =\> /lib/x86\_64-linux-gnu/libdl.so.2 (0x00007f9915a1e000)  
libstdc++.so.6 =\> /home/sypark/anaconda3/lib/python3.6/site-packages/torch/lib/…/…/…/…/libstdc++.so.6 (0x00007f9915708000)  
libutil.so.1 =\> /lib/x86\_64-linux-gnu/libutil.so.1 (0x00007f9915504000)  
libmkl\_intel\_lp64.so =\> /home/sypark/anaconda3/lib/python3.6/site-packages/torch/lib/…/…/…/…/libmkl\_intel\_lp64.so (0x00007f9914ae2000)  
libmkl\_intel\_thread.so =\> /home/sypark/anaconda3/lib/python3.6/site-packages/torch/lib/…/…/…/…/libmkl\_intel\_thread.so (0x00007f991307c000)  
libmkl\_core.so =\> /home/sypark/anaconda3/lib/python3.6/site-packages/torch/lib/…/…/…/…/libmkl\_core.so (0x00007f9911584000)  
libiomp5.so =\> /home/sypark/anaconda3/lib/python3.6/site-packages/torch/lib/…/…/…/…/libiomp5.so (0x00007f99111da000)  
libgomp.so.1 =\> /home/sypark/anaconda3/lib/python3.6/site-packages/torch/lib/…/…/…/…/libgomp.so.1 (0x00007f9910fca000)  
libcublas.so.8.0 =\> /home/sypark/anaconda3/lib/python3.6/site-packages/torch/lib/libcublas.so.8.0 (0x00007f990e617000)  
libcurand.so.8.0 =\> /home/sypark/anaconda3/lib/python3.6/site-packages/torch/lib/libcurand.so.8.0 (0x00007f990a6ac000)  
libcusparse.so.8.0 =\> /home/sypark/anaconda3/lib/python3.6/site-packages/torch/lib/libcusparse.so.8.0 (0x00007f9907b99000)

---

<div class="post-metadata">

**Author:** ![smth](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/smth/32/13_2.png) [@smth](https://discuss.pytorch.org/u/smth)\
**Post date:** [March 30, 2017, 5:41am UTC](https://discuss.pytorch.org/t/resolved-pyslice-adjustindices-error/1475/4 "2017-03-30T05:41:04Z")

</div>

it would help me if you gave the output of the command:

```bash
python --version

```

Thanks.

---

<div class="post-metadata">

**Author:** ![Seungyoung\_Park](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/seungyoung_park/32/48889_2.png) [@Seungyoung\_Park](https://discuss.pytorch.org/u/Seungyoung_Park)\
**Post date:** [March 30, 2017, 5:42am UTC](https://discuss.pytorch.org/t/resolved-pyslice-adjustindices-error/1475/5 "2017-03-30T05:42:49Z")

</div>

My python version is below.

```
Python 3.6.0 :: Anaconda 4.3.1 (64-bit)

```

Also, I updated pytorch by the command as

```
conda update pytorch torchvision -c soumith

```

Thanks.

---

<div class="post-metadata">

**Author:** ![smth](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/smth/32/13_2.png) [@smth](https://discuss.pytorch.org/u/smth)\
**Post date:** [March 30, 2017, 5:44am UTC](https://discuss.pytorch.org/t/resolved-pyslice-adjustindices-error/1475/6 "2017-03-30T05:44:16Z")

</div>

this is helpful, thank you. I’ll try to fix this error by tomorrow in the new binaries.

---

<div class="post-metadata">

**Author:** ![Seungyoung\_Park](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/seungyoung_park/32/48889_2.png) [@Seungyoung\_Park](https://discuss.pytorch.org/u/Seungyoung_Park)\
**Post date:** [March 30, 2017, 5:46am UTC](https://discuss.pytorch.org/t/resolved-pyslice-adjustindices-error/1475/7 "2017-03-30T05:46:00Z")

</div>

Thanks for your help!!

---

<div class="post-metadata">

**Author:** ![smth](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/smth/32/13_2.png) [@smth](https://discuss.pytorch.org/u/smth)\
**Post date:** [March 30, 2017, 9:26pm UTC](https://discuss.pytorch.org/t/resolved-pyslice-adjustindices-error/1475/8 "2017-03-30T21:26:50Z")

</div>

this should now be fixed in the latest binaries.  
Thanks for waiting.

---

<div class="post-metadata">

**Author:** ![Seungyoung\_Park](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/seungyoung_park/32/48889_2.png) [@Seungyoung\_Park](https://discuss.pytorch.org/u/Seungyoung_Park)\
**Post date:** [March 31, 2017, 1:08am UTC](https://discuss.pytorch.org/t/resolved-pyslice-adjustindices-error/1475/9 "2017-03-31T01:08:33Z")

</div>

I will check it.

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![Seungyoung\_Park](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/seungyoung_park/32/48889_2.png) [@Seungyoung\_Park](https://discuss.pytorch.org/u/Seungyoung_Park)\
**Post date:** [March 31, 2017, 1:29am UTC](https://discuss.pytorch.org/t/resolved-pyslice-adjustindices-error/1475/10 "2017-03-31T01:29:38Z")

</div>

I do not the reason, I got the out of memory error.  
Compared to the latest, the previous version consumes 9GB only (12GB total).  
I should stay at the previous version for a while.

Thanks.

---

<div class="post-metadata">

**Author:** ![smth](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/smth/32/13_2.png) [@smth](https://discuss.pytorch.org/u/smth)\
**Post date:** [March 31, 2017, 5:28am UTC](https://discuss.pytorch.org/t/resolved-pyslice-adjustindices-error/1475/11 "2017-03-31T05:28:58Z")

</div>

what is your application? is your code available somewhere to look?

---

<div class="post-metadata">

**Author:** ![Seungyoung\_Park](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/seungyoung_park/32/48889_2.png) [@Seungyoung\_Park](https://discuss.pytorch.org/u/Seungyoung_Park)\
**Post date:** [March 31, 2017, 5:56am UTC](https://discuss.pytorch.org/t/resolved-pyslice-adjustindices-error/1475/12 "2017-03-31T05:56:47Z")

</div>

My application is Inception-resnetv2 based autoencoder.

I would like to share my code to solve this problem, but I am not allowed to do this by the company for a while.

I will post the github address if I am allowed.

Sorry.

---

<div class="post-metadata">

**Author:** ![mderakhshani](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/mderakhshani/32/1735_2.png) [@mderakhshani](https://discuss.pytorch.org/u/mderakhshani)\
**Post date:** [April 14, 2017, 3:41pm UTC](https://discuss.pytorch.org/t/resolved-pyslice-adjustindices-error/1475/13 "2017-04-14T15:41:01Z")

</div>

Hey Man, I upgrade my **pytorch** with `conda update pytorch torchvision -c soumith`. But after updating i get this error:

> in ()  
> ----\> 1 import torch

> /home/mohammad/anaconda3/lib/python3.6/site-packages/torch/ **init**.py in ()  
> 51 sys.setdlopenflags(\_dl\_flags.RTLD\_GLOBAL | \_dl\_flags.RTLD\_NOW)  
> 52  
> —\> 53 from torch.\_C import \*  
> 54  
> 55 **all** += [name for name in dir(\_C)

> ImportError: /home/mohammad/anaconda3/lib/python3.6/site-packages/torch/lib/libTHC.so.1: cannot read file data

So what shoud i do then? How can I solve this?

---

<div class="post-metadata">

**Author:** ![leegang](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/leegang/32/386_2.png) [@leegang](https://discuss.pytorch.org/u/leegang)\
**Post date:** [April 15, 2017, 1:31pm UTC](https://discuss.pytorch.org/t/resolved-pyslice-adjustindices-error/1475/14 "2017-04-15T13:31:34Z")

</div>

I am using python 3.6 on Amazon linux.  
I have just updated pytorch via conda too.  
I also encountered a similar problem。

> import torchvision  
> Traceback (most recent call last):  
> File “”, line 1, in   
> File “/home/ec2-user/anaconda3/lib/python3.6/site-packages/torchvision-0.1.8-py3.6.egg/torchvision/ **init**.py”, line 2, in   
> File “/home/ec2-user/anaconda3/lib/python3.6/site-packages/torchvision-0.1.8-py3.6.egg/torchvision/datasets/ **init**.py”, line 1, in   
> File “/home/ec2-user/anaconda3/lib/python3.6/site-packages/torchvision-0.1.8-py3.6.egg/torchvision/datasets/lsun.py”, line 2, in   
> File “/home/ec2-user/anaconda3/lib/python3.6/site-packages/PIL/Image.py”, line 56, in   
> from . import \_imaging as core  
> ImportError: /home/ec2-user/anaconda3/lib/python3.6/site-packages/PIL/\_imaging.cpython-36m-x86\_64-linux-gnu.so: undefined symbol: PySlice\_Unpack

---

<div class="post-metadata">

**Author:** ![smth](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/smth/32/13_2.png) [@smth](https://discuss.pytorch.org/u/smth)\
**Post date:** [April 15, 2017, 4:40pm UTC](https://discuss.pytorch.org/t/resolved-pyslice-adjustindices-error/1475/15 "2017-04-15T16:40:46Z")

</div>

@leegang how did you install pytorch? from wheel or from conda?

---

<div class="post-metadata">

**Author:** ![leegang](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/leegang/32/386_2.png) [@leegang](https://discuss.pytorch.org/u/leegang)\
**Post date:** [April 15, 2017, 5:05pm UTC](https://discuss.pytorch.org/t/resolved-pyslice-adjustindices-error/1475/17 "2017-04-15T17:05:38Z")

</div>

`conda install pytorch torchvision cuda80 -c soumith`

@smth

---

<div class="post-metadata">

**Author:** ![smth](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/smth/32/13_2.png) [@smth](https://discuss.pytorch.org/u/smth)\
**Post date:** [April 15, 2017, 5:14pm UTC](https://discuss.pytorch.org/t/resolved-pyslice-adjustindices-error/1475/18 "2017-04-15T17:14:53Z")

</div>

that is weird. what is your output of:

```bash
python --version

```

and what is the output of `conda list | grep pytorch`

---

<div class="post-metadata">

**Author:** ![leegang](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/leegang/32/386_2.png) [@leegang](https://discuss.pytorch.org/u/leegang)\
**Post date:** [April 15, 2017, 5:17pm UTC](https://discuss.pytorch.org/t/resolved-pyslice-adjustindices-error/1475/19 "2017-04-15T17:17:07Z")

</div>

> [@smth](#):
>
> conda list | grep pytorch

`$ python --version`  
Python 3.6.0 :: Anaconda custom (64-bit)  
`$ conda list | grep pytorch`  
pytorch 0.1.11 py360\_4cu80 [cuda80] soumith

---

<div class="post-metadata">

**Author:** ![smth](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/smth/32/13_2.png) [@smth](https://discuss.pytorch.org/u/smth)\
**Post date:** [April 15, 2017, 5:21pm UTC](https://discuss.pytorch.org/t/resolved-pyslice-adjustindices-error/1475/20 "2017-04-15T17:21:42Z")

</div>

ok the problem is pytorch version `0.1.11_4`. It had this problem and I updated it to `0.1.11_5` which did not have this issue.  
Can you do:

```auto
conda uninstall pytorch
conda install pytorch -c soumith

```

Verify that it is installing `0.1.11_5`

---

<div class="post-metadata">

**Author:** ![leegang](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/leegang/32/386_2.png) [@leegang](https://discuss.pytorch.org/u/leegang)\
**Post date:** [April 15, 2017, 5:40pm UTC](https://discuss.pytorch.org/t/resolved-pyslice-adjustindices-error/1475/21 "2017-04-15T17:40:07Z")

</div>

```
[ec2-user@ip-172-31-40-200 Notebooks]$ conda install pytorch -c soumith
Fetching package metadata .....
......
Solving package specifications: .

Package plan for installation in environment /home/ec2-user/anaconda3:

The following NEW packages will be INSTALLED:

    pytorch: 0.1.11-py360_4cu80 soumith [cuda80]

Proceed ([y]/n)?
y

ec2-user@ip-172-31-40-200 Notebooks]$ conda list | grep pytorch
    pytorch 0.1.11 py360_4cu80 [cuda80] soumith
```

[Next page](https://discuss.pytorch.org/t/resolved-pyslice-adjustindices-error/1475.md?page=2)
