Skip to content

Can't launch local training job without hyperparameters #406

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
leopd opened this issue Sep 26, 2018 · 2 comments
Closed

Can't launch local training job without hyperparameters #406

leopd opened this issue Sep 26, 2018 · 2 comments

Comments

@leopd
Copy link
Contributor

leopd commented Sep 26, 2018

Please fill out the form below.

System Information

  • Framework (e.g. TensorFlow) / Algorithm (e.g. KMeans): Any
  • Framework Version: n/a
  • Python Version: 3.6
  • CPU or GPU: CPU
  • Python SDK Version: 1.10.1
  • Are you using a custom image: n/a

Describe the problem

If I try to call estimator.fit without hyperparameters, I get an error. I shouldn't need to specify any hyperparameters.

Minimal repro / logs

From a notebook call

import sagemaker
role = sagemaker.get_execution_role()
instance_type = 'local'

estimator = sagemaker.estimator.Estimator(role=role,
                      train_instance_count=1,
                      train_instance_type=instance_type,
                      image_name='simpleexample/cpu',
                      hyperparameters={},
                    )
estimator.fit({})

And I get

INFO:sagemaker:Creating training-job with name: cpu-2018-09-26-01-22-42-326
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-13-98552d1fe99a> in <module>()
      7                     )
      8 
----> 9 estimator.fit({})

~/miniconda3/envs/conda_python3/lib/python3.6/site-packages/sagemaker/estimator.py in fit(self, inputs, wait, logs, job_name)
    176         self._prepare_for_training(job_name=job_name)
    177 
--> 178         self.latest_training_job = _TrainingJob.start_new(self, inputs)
    179         if wait:
    180             self.latest_training_job.wait(logs=logs)

~/miniconda3/envs/conda_python3/lib/python3.6/site-packages/sagemaker/estimator.py in start_new(cls, estimator, inputs)
    361                                           job_name=estimator._current_job_name, output_config=config['output_config'],
    362                                           resource_config=config['resource_config'], hyperparameters=hyperparameters,
--> 363                                           stop_condition=config['stop_condition'], tags=estimator.tags)
    364 
    365         return cls(estimator.sagemaker_session, estimator._current_job_name)

~/miniconda3/envs/conda_python3/lib/python3.6/site-packages/sagemaker/session.py in train(self, image, input_mode, input_config, role, job_name, output_config, resource_config, hyperparameters, stop_condition, tags)
    262         LOGGER.info('Creating training-job with name: {}'.format(job_name))
    263         LOGGER.debug('train request: {}'.format(json.dumps(train_request, indent=4)))
--> 264         self.sagemaker_client.create_training_job(**train_request)
    265 
    266     def tune(self, job_name, strategy, objective_type, objective_metric_name,

TypeError: create_training_job() missing 1 required positional argument: 'HyperParameters'
@iquintero
Copy link
Contributor

Fixed in #375

@ChoiByungWook
Copy link
Contributor

Seems that the fix has been merged in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants