我正在使用 cleanrl 库,特别是脚本dqn_atari.py dqn_atari.py,我按照 说明进行操作以保存和加载目标和 Q 网络。
\n我在 conda 环境中本地运行它。
\n我之前没有加载过东西,所以错误可能是由于我的 wandb 配置造成的。错误为“wandb:错误访问 wandb_entity/wandb_project_name/project_id 的权限被拒绝”并出现在网上:
\nmodel = run.file("agent.pt")\nRun Code Online (Sandbox Code Playgroud)\n完整的输出是:
\nwandb: Currently logged in as: elena (use `wandb login --relogin` to force relogin)\n wandb: Tracking run with wandb version 0.12.15\nwandb: Run data is saved locally in /home/elena/workspace/playground/cleanrl/wandb/run-20220424_180429-2moec0qp\nwandb: Run `wandb offline` to turn off syncing.\nwandb: Resuming run BreakoutNoFrameskip-v4__dqn-save__1__1650816268\nwandb: \xe2\xad\x90 View project at https://wandb.ai/elena/test\nwandb: View run at https://wandb.ai/elena/test/runs/2moec0qp\nA.L.E: Arcade Learning Environment (version 0.7.4+069f8bd)\n[Powered by Stella]\n/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/stable_baselines3/common/buffers.py:219: UserWarning: This system does not have apparently enough memory to store the complete replay buffer 28.24GB > 8.35GB\n warnings.warn(\nwandb: ERROR Permission denied to access elena/test/2moec0qp\nTraceback (most recent call last):\n File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/wandb/sdk/lib/retry.py", line 102, in __call__\n result = self._call_fn(*args, **kwargs)\n File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/wandb/apis/public.py", line 2428, in download\n util.download_file_from_url(path, self.url, Api().api_key)\n File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/wandb/util.py", line 1197, in download_file_from_url\n response.raise_for_status()\n File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/requests/models.py", line 960, in raise_for_status\n raise HTTPError(http_error_msg, response=self)\nrequests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.wandb.ai/files/elena/test/2moec0qp/td_network.pt\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/wandb/apis/normalize.py", line 22, in wrapper\n return func(*args, **kwargs)\n File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/wandb/sdk/lib/retry.py", line 159, in wrapped_fn\n return retrier(*args, **kargs)\n File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/wandb/sdk/lib/retry.py", line 118, in __call__\n if not check_retry_fn(e):\n File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/wandb/util.py", line 877, in no_retry_auth\n raise CommError(f"Permission denied to access {wandb.run.path}")\nwandb.errors.CommError: Permission denied to access elena/test/2moec0qp\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "cleanrl/dqn_atari_save.py", line 184, in <module>\n model.download(f"models/{args.exp_name}/")\n File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/wandb/apis/normalize.py", line 58, in wrapper\n raise CommError(message, err).with_traceback(sys.exc_info()[2])\n File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/wandb/apis/normalize.py", line 22, in wrapper\n return func(*args, **kwargs)\n File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/wandb/sdk/lib/retry.py", line 159, in wrapped_fn\n return retrier(*args, **kargs)\n File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/wandb/sdk/lib/retry.py", line 118, in __call__\n if not check_retry_fn(e):\n File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/wandb/util.py", line 877, in no_retry_auth\n raise CommError(f"Permission denied to access {wandb.run.path}")\nwandb.errors.CommError: Permission denied to access elena/test/2moec0qp\nwandb: Waiting for W&B process to finish... (failed 1). Press Control-C to abort syncing.\nwandb: \nwandb: \nwandb: Run history:\nwandb: global_step \xe2\x96\x81\nwandb: \nwandb: Run summary:\nwandb: charts/episodic_return 0\nwandb: charts/epsilon 0.01\nwandb: charts/update 1969\nwandb: global_step 0\nwandb: \nwandb: Synced BreakoutNoFrameskip-v4__dqn-save__1__1650816268: https://wandb.ai/elena/test/runs/2moec0qp\nwandb: Synced 3 W&B file(s), 0 media file(s), 0 artifact file(s) and 1 other file(s)\nwandb: Find logs at: ./wandb/run-20220424_180429-2moec0qp/logs\nRun Code Online (Sandbox Code Playgroud)\n如您所见,我已登录,并且可以看到“https://wandb.ai/elena/test/runs/2moec0qp?workspace=user-elena”下的文件。引起我注意的是“requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.wandb.ai/files/elena/test/2moec0qp/agent.pt”。该路径确实看起来与 https 路径不同,但这也许不是问题所在?\n有什么想法吗?
\n您尝试访问的工件可能具有不同的名称,或者运行可能不存在。
在我的情况下,我尝试使用 wandb Api 下载模型
file_name = "model.h5"
api = wandb.Api()
run = api.run(
entity/project/run_id
)
run.file(file_name).download()
Run Code Online (Sandbox Code Playgroud)
在这种情况下,我的错误是 model_name 应该是model-best.h5
| 归档时间: |
|
| 查看次数: |
4543 次 |
| 最近记录: |