Skip to content

PyTorch estimatore searches for entry_point in source_dir #312

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
jendrikjoe opened this issue Jul 24, 2018 · 1 comment
Closed

PyTorch estimatore searches for entry_point in source_dir #312

jendrikjoe opened this issue Jul 24, 2018 · 1 comment

Comments

@jendrikjoe
Copy link

jendrikjoe commented Jul 24, 2018

System Information

  • PyTorch:
  • 0.4.0:
  • 3.6:
  • GPU:
  • 3.6:
  • No:

Describe the problem

Hey there everyone,

I am currently utilizing the PyTorch version of the SageMaker estimator and need to add additional files for it.
For that I used the source_dir option in the Estimator. However, different to what the documentation states, the entry_point has to reside in the source_dir. Is it possible to change that? Otherwise, I have to keep lots of files around ;)

Minimal repro / logs

estimator = PyTorch(entry_point="PredictionSageMaker.py",
                    source_dir='/path/to/source_dir_sagemaker',
                    role='aws role',
                    framework_version='0.4.0',
                    train_instance_count=1,
                    train_instance_type='ml.p2.xlarge',
                    hyperparameters={'epochs': 50, 'model': 'SimpleRNNNet', 'batch-size': 2048, 
                                 'learning-rate': 1e-5, 'mode': 'day'})

Traceback (most recent call last):
  File "(*deleted*)/launchSageMaker.py", line 28, in <module>
    estimator.fit({'train': '(*deleted*)', 'test': '(*deleted*)'})
  File "(*deleted*)/anaconda3/lib/python3.6/site-packages/sagemaker/estimator.py", line 176, in fit
    self._prepare_for_training(job_name=job_name)
  File "(*deleted*)/anaconda3/lib/python3.6/site-packages/sagemaker/estimator.py", line 542, in _prepare_for_training
    validate_source_dir(self.entry_point, self.source_dir)
  File "(*deleted*)/anaconda3/lib/python3.6/site-packages/sagemaker/fw_utils.py", line 87, in validate_source_dir
    raise ValueError('No file named "{}" was found in directory "{}".'.format(script, directory))
ValueError: No file named "PredictionSageMaker.py" was found in directory "(*deleted*)/source_dir_sagemaker".
@yangaws
Copy link
Contributor

yangaws commented Jul 26, 2018

Hi @jendrikjoe ,

Thanks for bringing this. This is a doc error. The entry_point file has to be in the source_dir if source_dir is used.

@nadiaya nadiaya closed this as completed Nov 2, 2018
apacker pushed a commit to apacker/sagemaker-python-sdk that referenced this issue Nov 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants