I'm moving my code from Google Colab to AWS Sagemaker. I do import torch
just after %pip install torch
and yet I get ModuleNotFoundError: No module named 'torch'
!
I can remember I had used torch on Sagemaker before and I did not get such error!
P.S. I have tried kernel restart.
Asked
Active
Viewed 29 times
0

soroush
- 45
- 8
-
Are you using SageMaker Notebooks or Studio? In case of Studio and Data Science kernel it is installed by default. Also, can you do a pip list to see if the package is installed? – Raghu Ramesha Aug 14 '23 at 21:47
-
Thank you @RaghuRamesha for your recommendation. I'm using Studio and Data Science 3.0, and it was not installed by default. I faced many inconsistencies in Sagemaker Studio compared to when I used Google Colab. No solutions on the internet worked for me. I deleted all the resources to the domain and created a new one from scratch. – soroush Aug 14 '23 at 22:58
-
1Studio has a pytorch kernel you can use that which comes preinstalled with torch. – Arun Lokanatha Aug 15 '23 at 00:05