Skip to content

Make RL training compatible with PyTorch #1520

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

Merged
merged 4 commits into from
Oct 9, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
indent correction
  • Loading branch information
annaluo676 committed Oct 7, 2020
commit b7c09cd3fa3573511390e33e56ab7d6f982e96ee
16 changes: 8 additions & 8 deletions reinforcement_learning/common/sagemaker_rl/ray_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,14 +234,14 @@ def create_tf_serving_model(self, algorithm=None, env_string=None):
cls = get_agent_class(algorithm)
with open(os.path.join(MODEL_OUTPUT_DIR, "params.json")) as config_json:
config = json.load(config_json)
print("Loaded config for TensorFlow serving.")
config["monitor"] = False
config["num_workers"] = 1
config["num_gpus"] = 0
agent = cls(env=env_string, config=config)
checkpoint = os.path.join(MODEL_OUTPUT_DIR, "checkpoint")
agent.restore(checkpoint)
export_tf_serving(agent, MODEL_OUTPUT_DIR)
print("Loaded config for TensorFlow serving.")
config["monitor"] = False
config["num_workers"] = 1
config["num_gpus"] = 0
agent = cls(env=env_string, config=config)
checkpoint = os.path.join(MODEL_OUTPUT_DIR, "checkpoint")
agent.restore(checkpoint)
export_tf_serving(agent, MODEL_OUTPUT_DIR)

def save_checkpoint_and_serving_model(self, algorithm=None, env_string=None, use_pytorch=False):
self.save_experiment_config()
Expand Down