1
votes

If I am not using the notebook on AWS but instead just the Sagemaker CLI and want to train a model, can I specify a local path to read from and write to?

2

2 Answers

4
votes

If you use local mode with the SageMaker Python SDK, you can train using local data:

from sagemaker.mxnet import MXNet

mxnet_estimator = MXNet('train.py',
                        train_instance_type='local',
                        train_instance_count=1)

mxnet_estimator.fit('file:///tmp/my_training_data')

However, this only works if you are training a model locally, not on SageMaker. If you want to train on SageMaker, then yes, you do need to use S3.

For more about local mode: https://github.com/aws/sagemaker-python-sdk#local-mode

0
votes

As far as I know, you cannot do that. Sagemaker's framework and estimator API makes it easy for SageMaker to feed in data to the model at every iteration or epoch. Feeding from local would drastically slow down the process. That begs the question - qhy not use S3. Its cheap and fast.