Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import sagemaker
from sagemaker.tensorflow import TensorFlow
from sagemaker import Session
sess = sagemaker.Session()
role = sagemaker.get_execution_role()
# Create the apropriate folder struture, no need to be the same as I use
train_dir = 'data/train'
test_dir = 'data/test', 'train_images.npy'), train_images), 'train_labels.npy'), train_labels), 'test_images.npy'), test_images), 'test_labels.npy'), test_labels)
print(f"Sagemaker bucket: {sess.default_bucket()}")
s3_prefix = 'fashion-mnist'
traindata_s3_prefix = '{}/data/train'.format(s3_prefix)
testdata_s3_prefix = '{}/data/test'.format(s3_prefix)
train_s3 = sagemaker.Session().upload_data(path='./data/train/', key_prefix=traindata_s3_prefix)
test_s3 = sagemaker.Session().upload_data(path='./data/test/', key_prefix=testdata_s3_prefix)
inputs = {'train':train_s3, 'test': test_s3}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment