aws / aws/amazon-sagemaker-examples

RL example news vendors does not run

Open
#1,686 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
11k
Forks
7k
Avg merge
8h 29m
Merged PRs (30d)
8

Description

Problem notebook:
```
reinforcement_learning/rl_resource_allocation_ray_customEnv/rl_news_vendor_ray_custom.ipynb
```

Problem cell:
```
train_entry_point = "train_news_vendor.py"
train_job_max_duration_in_seconds = 60 * 15 # 15 mins to make sure TrainingJobAnalytics shows at least two points

estimator = RLEstimator(entry_point=train_entry_point,
source_dir="src",
dependencies=["common/sagemaker_rl"],
toolkit=RLToolkit.RAY,
toolkit_version='0.6.5',
framework=RLFramework.TENSORFLOW,
role=role,
train_instance_type=instance_type,
train_instance_count=1,
output_path=s3_output_path,
base_job_name=job_name_prefix,
metric_definitions=metric_definitions,
train_max_run=train_job_max_duration_in_seconds,
hyperparameters={}
)

estimator.fit(wait=local_mode)
job_name = estimator.latest_training_job.job_name
print("Training job: %s" % job_name)
```
Traceback:
```
algo-1-2p1nm_1 | /usr/bin/python train_news_vendor.py
algo-1-2p1nm_1 |
algo-1-2p1nm_1 |
algo-1-2p1nm_1 | Traceback (most recent call last):
algo-1-2p1nm_1 | File "train_news_vendor.py", line 3, in
algo-1-2p1nm_1 | from sagemaker_rl.ray_launcher import SageMakerRayLauncher
algo-1-2p1nm_1 | File "/opt/ml/code/sagemaker_rl/ray_launcher.py", line 13, in
algo-1-2p1nm_1 | from .tf_serving_utils import export_tf_serving, natural_keys, change_permissions_recursive
algo-1-2p1nm_1 | File "/opt/ml/code/sagemaker_rl/tf_serving_utils.py", line 4, in
algo-1-2p1nm_1 | from ray.rllib.utils.framework import try_import_tf
algo-1-2p1nm_1 | ModuleNotFoundError: No module named 'ray.rllib.utils.framework'
algo-1-2p1nm_1 | 2020-11-02 21:51:33,092 sagemaker-containers ERROR ExecuteUserScriptError:
algo-1-2p1nm_1 | Command "/usr/bin/python train_news_vendor.py"
```

Note:
Mode: local
Kernel: mxnet_p36
Related to #1685

Contributor guide

Open the contributing guide

Research direction

Start with reinforcement_learning/rl_resource_allocation_ray_customEnv/rl_news_vendor_ray_custom.ipynb and its train_news_vendor.py entry point, then inspect common/sagemaker_rl and sagemaker_rl/tf_serving_utils.py around the failing ray.rllib.utils.framework import. Run the notebook in local mode and confirm training starts without ModuleNotFoundError.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python, tensorflow
Domain
machine-learning
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.