Skip to content

Bug in cleanrl_utils/tuner.py #533

@dtannebe

Description

@dtannebe

Hi all,

I have found a bug in the provided optuna-based tuner tuner.py.

line 90:
sys.argv = algo_command + [f"--env-id={env_id}", f"--seed={seed}"]

adds the algo_command list, created from the params dict before, to the sys.argv command line parameters given to the script.

But in the current implementation here, the first parameter from the list gets into sys.argv[0], which is then overwritten by the script name.
Checking the received command line arguments in the script, the first command line parameter is the expected script name, followed by the defined optimization parameters, but starting from the second!

FIX change line 90 to append the parameters:
sys.argv = [sys.argv[0]] + algo_command + [f"--env_id={env_id}", f"--seed={seed}"]

I hope this helps other people not wasting so much time as me in thinking to test different parameters, while the first parameter was always fixed. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions