Using pytorch cuda in AWS sagemaker notebook instance
In colab, whenever we need GPU, we simply click change runtime type and change hardware accelarator to GPU
and cuda becomes available, torch.cuda.is_available() is True
How to do this is AWS sagemaker, i.e. turning on cuda.
I am new to AWS and trying to train model using pytorch in aws sagemaker, where Pytorch code is first tested in colab environment.
my sagemaker notebook insatnce is ml.t2.medium

Using AWS Sagemaker you don't need to worry about the GPU, you simply select an instance type with GPU ans Sagemaker will use it. Specifically ml.t2.medium doesn't have a GPU but it's anyway not the right way to train a model.
Basically you have 2 canonical ways to use Sagemaker (look at the documentation and examples please), the first is to use a notebook with a limited computing resource to spin up a training job using a prebuilt image, in that case when you call the estimator you simply specify what instance type you want (you'll choose one with GPU, looking at the costs). The second way is to use your own container, push it to ECR and launch a training job from the console, where you specify the instance type.
