Skip to content
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

[RLlib] Issue 41370: Tune update_config should use config.to_dict() if config is an _Config. #42116

Merged
6 changes: 4 additions & 2 deletions python/ray/tune/logger/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def close(self):
self.local_out.close()

def update_config(self, config: Dict):
self.config = config
self.config = config if isinstance(config, dict) else config.to_dict()
simonsays1980 marked this conversation as resolved.
Show resolved Hide resolved
config_out = os.path.join(self.logdir, EXPR_PARAM_FILE)
with open(config_out, "w") as f:
json.dump(self.config, f, indent=2, sort_keys=True, cls=SafeFallbackEncoder)
Expand Down Expand Up @@ -115,7 +115,9 @@ def log_trial_end(self, trial: "Trial", failed: bool = False):
del self._trial_files[trial]

def update_config(self, trial: "Trial", config: Dict):
self._trial_configs[trial] = config
self._trial_configs[trial] = (
simonsays1980 marked this conversation as resolved.
Show resolved Hide resolved
config if isinstance(config, dict) else config.to_dict()
)

config_out = os.path.join(trial.local_path, EXPR_PARAM_FILE)
with open(config_out, "w") as f:
Expand Down