1

I am in a weird scenario were I am forced to use torch 1.3.1 (due to hardware see: https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda/#/). I read from the pytorch docs that it's corresponding version of torchvision is 0.4.1 (https://pypi.org/project/torchvision/):

Installation

We recommend Anaconda as Python package management system. Please refer to pytorch.org for the detail of PyTorch (torch) installation. The following is the corresponding torchvision versions and supported Python versions.

Installation
We recommend Anaconda as Python package management system. Please refer to pytorch.org for the detail of PyTorch (torch) installation. The following is the corresponding torchvision versions and supported Python versions.

torch torchvision python
master / nightly  master / nightly    >=3.6
1.5.0 0.6.0   >=3.5
1.4.0 0.5.0   ==2.7, >=3.5, <=3.8
1.3.1 0.4.2   ==2.7, >=3.5, <=3.7
1.3.0 0.4.1   ==2.7, >=3.5, <=3.7
1.2.0 0.4.0   ==2.7, >=3.5, <=3.7
1.1.0 0.3.0   ==2.7, >=3.5, <=3.7
<=1.0.1   0.2.2   ==2.7, >=3.5, <=3.7

but for some reason I have the wrong version of it:

torchvision 0.2.2 pypi_0 pypi

is there a way to install the right version of torchvision?


What I've tried:

First I tried force installing the right version with conda. Conda couldn't find the version of torchvision that I need:

$ conda install torchvision==0.4.2
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - torchvision==0.4.2

Current channels:

  - https://repo.anaconda.com/pkgs/main/linux-ppc64le
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/linux-ppc64le
  - https://repo.anaconda.com/pkgs/r/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

Then I proceeded to try to install it regardless with pip

$ pip install torchvision==0.4.2
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement torchvision==0.4.2 (from versions: 0.1.6, 0.1.7, 0.1.8, 0.1.9, 0.2.0, 0.2.1, 0.2.2, 0.2.2.post2, 0.2.2.post3)
ERROR: No matching distribution found for torchvision==0.4.2

got an error too.

Is there anything else to try?


I tried but it failed:

conda install torchvision==0.4.2 -c pytorch

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - torchvision==0.4.2

Current channels:

  - https://conda.anaconda.org/pytorch/linux-ppc64le
  - https://conda.anaconda.org/pytorch/noarch
  - https://repo.anaconda.com/pkgs/main/linux-ppc64le
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/linux-ppc64le
  - https://repo.anaconda.com/pkgs/r/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.


related:

Charlie Parker
  • 5,884
  • 57
  • 198
  • 323
  • Adding channel via `-c pytorch` didn't help? – Szymon Maszke Sep 23 '20 at 18:14
  • @SzymonMaszke do you mean `conda install torchvision==0.4.2 -c pytorch`? will try that now. – Charlie Parker Sep 23 '20 at 18:15
  • 1
    @SzymonMaszke I tried installing pytorch from scratch with standard command `conda install pytorch torchvision cudatoolkit=10.2 -c pytorch` and that screwed up everything so I had to make the conda env the sys admins provided. The command looked similar to the one you suggested so I didn't try it. But I will now. It's still running... :/ – Charlie Parker Sep 23 '20 at 18:17
  • @SzymonMaszke ok so doing `$ conda install torchvision -c pytorch` also changes my version of pytorch to `1.1.0`. That is why I didn't try that...what I need is a way to specify which version of torchvision to install. Ideally `0.4.2` using conda. – Charlie Parker Sep 23 '20 at 18:27
  • My command did pin the version `0.4.2` and I think it should work (`conda install torchvision==0.4.2 -c pytorch`). Also are you sure you need `0.4.2`? AFAIK `torchvision` isn't that strict dependent on pytorch version and should be fine. – Szymon Maszke Sep 23 '20 at 18:29
  • @SzymonMaszke great questions! I cannot change the version to pytorch so I am stuck with `1.3.1` and that is 100% sure. Thats due to the IBM computer(s)/cluster/HPC I am using. But, for torchvision I can use whatever doesn't break things. The pytorch library I am trying to use (torchmeta) has a version that works with pytorch `1.3.1` and torchvision `0.4.2` which seem to be the ones that come together form the link I shared. This is the real issue I am trying to solve I guess: https://github.com/tristandeleu/pytorch-meta/issues/95 – Charlie Parker Sep 23 '20 at 18:34
  • @SzymonMaszke I am rebuilding the conda environment. I will try your new suggestion `conda install torchvision==0.4.2 -c pytorch`. It seems like a sensible thing to try. – Charlie Parker Sep 23 '20 at 18:37
  • @SzymonMaszke why does it need the `-c pytorch` option? (asking while I wait for the env to rebuild and get insights into whats going on) – Charlie Parker Sep 23 '20 at 18:43
  • 1
    Specifies channel from which conda package will be downloaded. It won't find `torchvision` as it's not in the default conda channel (as it is a third party). – Szymon Maszke Sep 23 '20 at 18:47
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/221963/discussion-between-szymon-maszke-and-charlie-parker). – Szymon Maszke Sep 23 '20 at 18:48

1 Answers1

1

For all details check (https://github.com/IBM/powerai/issues/268).

Make sure you have the right conda channel prepended:

conda config --prepend channels https://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda/#/

then install the powerai wmlce that you want e.g. 1.7.0 (most recent as of this writing):

conda create -n my_new_env python=3.7 powerai=1.7.0
conda activate my_new_env
Charlie Parker
  • 5,884
  • 57
  • 198
  • 323