C3W2 Assignment - File Not Found Error

I just started the week 2 lab. I’m on exercise 1: Create an ECR URI using the PyTorch framework. I typed in the correct framework and tried to run the cell, but I’m getting a FileNotFoundError:

FileNotFoundError: [Errno 2] No such file or directory: ‘/opt/conda/lib/python3.7/site-packages/sagemaker/image_uri_config/PyTorch.json’

Please help!

8 Likes

Hi @rkarming!

We are here for you :slight_smile: . Can you please share a screenshot of your error? Maybe, also more details if you have successfully ran all previous cells until this point…

Cheers!

Hi @Raul,

Here is a screenshot of my error. Yes, I successfully ran all previous cells until this point, no problems. I also didn’t modify any of the cells up until this point (when I replaced “None” with the correct PyTorch framework).

I also got the same error…

Guys,

Can you try reboot and run this cell again? Specially the one I highlighted, with conda installation.

In additition, make sure you don’t leave out commas or quotes in your code.

# please ignore warning messages during the installation
!pip install --disable-pip-version-check -q sagemaker==2.35.0
**!conda install -q -y pytorch==1.6.0 -c pytorch**
!pip install --disable-pip-version-check -q transformers==3.5.1

Let me know. I hope it works out.

Cheers!

I tried your suggestions, but I’m still having the same problem. Screenshots attached.


I resolved this issue by passing the framework string value in lower case instead of camel case. As this worked (uri output instead of the error msg), and I completed and passed the lab, I concluded that the file name in question must be pytorch.json.

4 Likes

Yes! That was I was going to suggest guys: to pay attention to upper and lower cases. I’m glad you figured it out.

Happy learning!

That worked! Thank you for your help!

Yes, just list the directory and you can see that pytorch.json
!ls /opt/conda/lib/python3.7/site-packages/sagemaker/image_uri_config

I ran into the same problem, but ‘ls’ saved the day. Here is a suggestion to the course content team. Either…

  1. Update the cell comment to the correct string, or
  2. Instruct people to use ‘ls’ or similar means to look up the correct JSON file name.

Having an incorrect string as part of the cell instructions is not fatal but a waste of people’s time.

2 Likes