Please fill out the form below.
Python SDK Version:
Are you using a custom image:
No
Documentation at https://sagemaker.readthedocs.io/en/stable/overview.html#local-mode shows creating estimator without passing role, when doing this locally I get an error that role is a required positional parameter.
specifically this code:
from sagemaker.mxnet import MXNet
mxnet_estimator = MXNet('train.py',
train_instance_type='local',
train_instance_count=1,
framework_version='1.2.1')
mxnet_estimator.fit('file:///tmp/my_training_data')
And why would an IAM role be required for local mode anyway?
from sagemaker.tensorflow import TensorFlow
mnist_estimator = TensorFlow(entry_point='mnist.py',
training_steps=10,
evaluation_steps=10,
train_instance_count=1,
train_instance_type='local')
logs:
Traceback (most recent call last):
File "sm_driver.py", line 8, in <module>
train_instance_type='local')
File "/home/sdhawley/work/cohereum/mnist/.venv/lib/python3.7/site-packages/sagemaker/tensorflow/estimator.py", line 235, in __init__
super(TensorFlow, self).__init__(image_name=image_name, **kwargs)
File "/home/sdhawley/work/cohereum/mnist/.venv/lib/python3.7/site-packages/sagemaker/estimator.py", line 805, in __init__
super(Framework, self).__init__(**kwargs)
TypeError: __init__() missing 1 required positional argument: 'role'
Hi @stevehawley
Thanks for your observation. Although role is not necessary in local mode, it allows a smoother transition to other SageMaker services, which is why we keep the parameter.
I updated the documentation as suggested.
Thanks for using SageMaker
Sorry to bring this up again. @mvsusp Thanks for giving an answer to it, but I still don't get it: "Although role is not necessary in local mode ...", so we do agree that "role" needs to be an optional parameter, not a required one right?
Making it "required" means that you need to have an AWS account, which many people don't, and won't prefer to be forced to have one.
Making it "required" means that you need to have an AWS account, which many people don't, and won't prefer to be forced to have one.
This is a pain point for me too... it seems local mode isn't really local.
I have to specify a role and that role is being validated before I can run the training job locally. I was expecting this could be done completely separately from AWS without needing any credentials.
Unfortunately, for my use case, I can't have an AWS account and a role being defined as a dependency.
Most helpful comment
Sorry to bring this up again. @mvsusp Thanks for giving an answer to it, but I still don't get it: "Although role is not necessary in local mode ...", so we do agree that "role" needs to be an optional parameter, not a required one right?
Making it "required" means that you need to have an AWS account, which many people don't, and won't prefer to be forced to have one.