Skip to content

Instantly share code, notes, and snippets.

@DalyaG
Created April 20, 2020 07:25
Show Gist options
  • Save DalyaG/e2a3df5c43e28913dddcd8a29151de94 to your computer and use it in GitHub Desktop.
Save DalyaG/e2a3df5c43e28913dddcd8a29151de94 to your computer and use it in GitHub Desktop.
log input params
import os
import json
# Here we assume: params = MyParamsClass()
sorted_params_dict = {k: params.__dict__[k] for k
in sorted(params.__dict__.keys())}
params_filepath = os.path.join(log_dir, 'params.json')
json.dump(sorted_params_dict, open(params_filepath, 'w'), indent=4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment