Sagemaker-python-sdk: Docs suggest role is optional in local mode

Created on 18 Mar 2019  路  3Comments  路  Source: aws/sagemaker-python-sdk

Please fill out the form below.

System Information

  • Framework (e.g. TensorFlow) / Algorithm (e.g. KMeans):
    TensorFlow
  • Framework Version:
    1.12
  • Python Version:
    3.7
  • CPU or GPU:
    NA
  • Python SDK Version:

  • Are you using a custom image:
    No

    Describe the problem

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?

Minimal repro / logs

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'
  • Exact command to reproduce:

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.

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

meownoid picture meownoid  路  5Comments

evakravi picture evakravi  路  3Comments

OktayGardener picture OktayGardener  路  5Comments

velociraptor111 picture velociraptor111  路  3Comments

jguo16 picture jguo16  路  3Comments