run and experiment_name from docs/advanced/resume-training are undefined
Closed this issue · 5 comments
Melanol commented
Problem Description
Here. Also, am I supposed to use cleanrl_utils/resume.py instead of what is in the docs?
Checklist
- I have installed dependencies via
poetry install
(see CleanRL's installation guideline. - I have checked that there is no similar issue in the repo.
- I have checked the documentation site and found not relevant information in GitHub issues.
vwxyzjn commented
The resume.py
is something slightly more advanced (and kind of deprecated). You should rely on the pointers in docs.
Melanol commented
@vwxyzjn Docs are not helpful, as run
and experiment_name
are not defined anywhere before the following part, including algos:
if args.track and wandb.run.resumed:
starting_update = run.summary.get("charts/update") + 1
global_step = starting_update * args.batch_size
api = wandb.Api()
run = api.run(f"{run.entity}/{run.project}/{run.id}")
model = run.file("agent.pt")
model.download(f"models/{experiment_name}/")
agent.load_state_dict(torch.load(
f"models/{experiment_name}/agent.pt", map_location=device))
agent.eval()
print(f"resumed at update {starting_update}")
vwxyzjn commented
experiment_name
is now run_name
.
api = wandb.Api()
run = api.run(f"{run.entity}/{run.project}/{run.id}")
Melanol commented
run = api.run(f"{run.entity}/{run.project}/{run.id}")
You are trying to define run
with run
that is not defined.
vwxyzjn commented
Here is the reference code https://wandb.ai/costa-huang/cleanRL/runs/21421tda/code?workspace=user-costa-huang