Skip to content

Instantly share code, notes, and snippets.

import torch
from torch import nn
from torch.utils.data import DataLoader
from torchvision import datasets
from torchvision.transforms import ToTensor
import os
import argparse
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import torch
from torch import nn
from torch.utils.data import DataLoader, Dataset
from torchvision import datasets
from torchvision.transforms import ToTensor
import os
import argparse
import struct
import numpy as np
import gzip
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vikeshpandey
vikeshpandey / vpc-with-no-internet.yaml
Last active May 11, 2023 14:23
vpc-with-no-internet.yaml
AWSTemplateFormatVersion: "2010-09-09"
Description: VPC Mode with no internet access - Provision the networking resources to be used by the Amazon SageMaker Studio domain.
Resources:
SageMakerVPC:
Type: AWS::EC2::VPC
Properties:
CidrBlock: 10.0.0.0/16
EnableDnsSupport: true
@vikeshpandey
vikeshpandey / sagemaker-studio-with-vpc.yaml
Created May 11, 2023 14:15
sagemaker-studio-with-vpc.yaml
AWSTemplateFormatVersion: '2010-09-09'
Description: VPC Mode with no internet access - Provision an Amazon SageMaker Studio domain, a user profile, and the JupyterServer app.
Parameters:
UserProfileName:
Type: String
Description: User profile name
Default: default-user
CoreNetworkingStackName:
Description: Name of the networking stack you created earlier
Type: String
  1. Delete the SageMaker Studio and associated resources

Go to the CloudFormation console. Locate the second stack you created (named SageMaker-Studio-VPC-No-Internet, if you used the suggested name in the blog) and delete the stack. When the stack is deleted, move to the next step.

  1. Remove the Amazon Elastic File System (EFS) volume, Elastic Network Interface and security groups created by SageMaker Studio

Run the clean up script to delete the resources that were automatically created when you created the SageMaker Studio domain, including the Amazon EFS volume, Elastic Network Interface and security groups.

Delete the VPC and other networking resources