Modify the Trainer class to handle simultaneous execution of Ray Tune and Weights & Biases (#10823)

* Modify the _hp_search_setup method on the Trainer class to handle the wandb argument passed by Ray Tune to model config.

* Reformat single quotes as double quotes.
This commit is contained in:
Ruan Chaves 2021-03-22 15:04:51 -03:00 committed by GitHub
parent 125ccead71
commit a8d4d6776d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -700,8 +700,12 @@ class Trainer:
if self.hp_search_backend is None or trial is None:
return
if self.hp_search_backend == HPSearchBackend.OPTUNA:
params = self.hp_space(trial)
elif self.hp_search_backend == HPSearchBackend.RAY:
params = trial
params.pop("wandb", None)
params = self.hp_space(trial) if self.hp_search_backend == HPSearchBackend.OPTUNA else trial
for key, value in params.items():
if not hasattr(self.args, key):
raise AttributeError(