【问题标题】:Why conda installs old pytorch with by default with cudatoolkit=11.2为什么 conda 默认使用 cudatoolkit=11.2 安装旧的 pytorch
【发布时间】:2021-09-04 20:53:58
【问题描述】:

我正在尝试在 google colab 上为 cudatoolkit=11.2 安装 conda,使用:

conda install pytorch cudatoolkit=11.2 -c pytorch -c nvidia

但是为什么它安装旧的pytorch=1.0.0 版本而不是>1.6

如果我尝试强制安装pytorch=1.6,则会出现以下错误:

UnsatisfiableError: The following specifications were found to be incompatible with a past
explicit spec that is not an explicit spec in this operation (cudatoolkit):

  - cudatoolkit=11.2
  - pytorch=1.6 -> cudatoolkit[version='>=10.1,<10.2|>=10.2,<10.3|>=9.2,<9.3']

The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Package setuptools conflicts for:
setuptools
python=3.7 -> pip -> setuptools
conda[version='>=4.10.3'] -> setuptools[version='>=31.0.1']
wheel -> setuptools
pip -> setuptools
...

根据答案编辑:

当我尝试使用conda install -c conda-forge pytorch cudatoolkit=11.2 时,会出现以下错误。

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

  - cudatoolkit=11.2
  - __glibc[version='>=2.17,<3.0.a0']

Current channels:

  - https://conda.anaconda.org/conda-forge/linux-64
  - https://conda.anaconda.org/conda-forge/noarch
  - https://repo.anaconda.com/pkgs/main/linux-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/free/linux-64
  - https://repo.anaconda.com/pkgs/free/noarch
  - https://repo.anaconda.com/pkgs/r/linux-64
  - https://repo.anaconda.com/pkgs/r/noarch
  - https://repo.anaconda.com/pkgs/pro/linux-64
  - https://repo.anaconda.com/pkgs/pro/noarch

【问题讨论】:

  • This 可能有帮助吗?
  • 您能否使用导致此错误的 Conda 设置创建一个公共 CoLab 笔记本?

标签: pytorch conda


【解决方案1】:

The pytorch channel 还没有任何与cudatoolkit=11.2 兼容的pytorch 构建。求解器发现的是旧版本的 PyTorch,它们在依赖版本上没有适当的上限。

如果您坚持使用cudatoolkit=11.2,那么您需要坚持使用 Conda Forge 堆栈:

conda install -c conda-forge pytorch cudatoolkit=11.2

否则,如果您想要官方的 PyTorch 构建,那么它们会构建到 v11.1 兼容版本:

conda install -c pytorch -c conda-forge pytorch cudatoolkit=11.1

【讨论】:

  • 仍然给我错误:PackagesNotFoundError: The following packages are not available from current channels: - cudatoolkit=11.2
  • @kkgarg 你一定有问题。我刚刚验证了这两个命令都有效。如果使用cudatoolkit=11.2,则必须包括-c conda-forge 而不是-c pytorch
  • 根据您在答案中的建议将错误添加到问题中,它没有解决我的问题
  • @kkgarg 这很令人困惑,因为conda search -c conda-forge/linux-64 cudatoolkit=11.2 解析了四个兼容的构建。
  • 它在 colab 上工作,也许我正在尝试其他一些可能具有不同 cuda 版本的设置的命令。但是 Colab 有 11.2 并且在那里运行良好。
猜你喜欢
  • 2020-07-25
  • 1970-01-01
  • 2020-04-19
  • 1970-01-01
  • 2022-10-23
  • 2015-10-02
  • 2014-08-09
  • 2019-08-02
  • 1970-01-01
相关资源
最近更新 更多