1

如果我被迫使用torch,我处于一个奇怪的场景中1.3.1(由于硬件,请参阅:https ://public.dhe.ibm.com/ibmdl/export/pub/software/server/ibm-ai/conda/#/ ) . 我从 pytorch 文档中读到它的对应版本的 torchvision 是0.4.1https://pypi.org/project/torchvision/):

安装

我们推荐 Anaconda 作为 Python 包管理系统。PyTorch(火炬)安装的详细信息请参考pytorch.org。以下是对应的torchvision版本和支持的Python版本。

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

但由于某种原因,我的版本错误:

torchvision 0.2.2 pypi_0 pypi

有没有办法安装正确版本的torchvision?


我试过的:

首先,我尝试使用 conda 强制安装正确的版本。Conda 找不到我需要的 torchvision 版本:

$ 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.

然后我继续尝试安装它,不管 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

也有错误。

还有什么可以尝试的吗?


我试过但失败了:

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.


有关的:

4

1 回答 1

1

有关所有详细信息,请检查 ( https://github.com/IBM/powerai/issues/268 )。

确保您预先设置了正确的 conda 通道:

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

然后安装您想要的 powerai wmlce,例如 1.7.0(撰写本文时的最新版本):

conda create -n my_new_env python=3.7 powerai=1.7.0
conda activate my_new_env
于 2020-09-24T14:39:25.340 回答