Bridget Toomey
Bridget Toomey

Reputation: 21

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. However, I'm getting a ResolvePackageNotFound error. Note that I'm just working in a Jupyter notebook with a kernel corresponding to this Conda environment. 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.

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. I tried it with conda version 4.8.3 and 4.9.2 as well. If I specify pytorch>=1.5.0, I'm able to create the environment successfully.

Does anyone have any idea why I can't create an environment successfully with more recent versions of 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.

Upvotes: 2

Views: 3015

Answers (1)

Ashutosh Kumar
Ashutosh Kumar

Reputation: 109

Sagemaker instances do not always have support for latest packages. Check this link for the list of supported images in Sagemaker instances.

Upvotes: 1

Related Questions