简体   繁体   English

如何在 AWS Sagemaker 中通过 Conda 指定和安装最新版本的 PyTorch?

[英]How do I specify and install the latest version of PyTorch via Conda in AWS Sagemaker?

I'm attempting to use a recent version of PyTorch (1.7.0) in a Conda environment on Sagemaker by specifying the package version in an environment.yml file.我试图通过在 environment.yml 文件中指定 package 版本在 Sagemaker 的 Conda 环境中使用最新版本的 PyTorch (1.7.0)。 However, I'm getting a ResolvePackageNotFound error.但是,我收到 ResolvePackageNotFound 错误。 Note that I'm just working in a Jupyter notebook with a kernel corresponding to this Conda environment.请注意,我只是在 Jupyter 笔记本上工作,其中 kernel 对应于这个 Conda 环境。 I'm not using a deep learning image.我没有使用深度学习图像。

Steps to reproduce:重现步骤:

Save the code below as a.yml file, navigate to where this.yml file is stored, and run conda env create environment.yml .将下面的代码保存为 .yml 文件,导航到 this.yml 文件的存储位置,然后运行conda env create environment.yml

name: test_env
dependencies:
  - numpy
  - pandas
  - pytorch>=1.7.0
  - torchvision
  - scipy
  - ipykernel
  - torchvision

I've tried this on instances of various types (ml.p2.xlarge, ml.p3.2xlarge, and ml.p3.8xlarge) and have gotten the same error each time.我已经在各种类型的实例(ml.p2.xlarge、ml.p3.2xlarge 和 ml.p3.8xlarge)上进行了尝试,并且每次都得到相同的错误。 I tried it with conda version 4.8.3 and 4.9.2 as well.我也使用 conda 4.8.3 和 4.9.2 版本进行了尝试。 If I specify pytorch>=1.5.0 , I'm able to create the environment successfully.如果我指定pytorch>=1.5.0 ,我可以成功创建环境。

Does anyone have any idea why I can't create an environment successfully with more recent versions of PyTorch?有谁知道为什么我不能使用更新版本的 PyTorch 成功创建环境? Based on this documentation , I wonder if Sagemaker has preinstalled certain versions of PyTorch, and something is going awry when I attempt to use a more recent version.根据这个文档,我想知道 Sagemaker 是否预装了 PyTorch 的某些版本,当我尝试使用更新的版本时出现了问题。

Sagemaker instances do not always have support for latest packages. Sagemaker 实例并不总是支持最新的软件包。 Check this link for the list of supported images in Sagemaker instances.检查此链接以获取 Sagemaker 实例中支持的图像列表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM