我正在使用cleanrl库,特别是脚本atari.py dqn_atari.py,其中我跟踪了使用说明,以便保存和加载目标和q网络。
我在conda环境中本地运行它。
我以前还没有加载一些东西,所以错误可能是由于我的wandb配置。错误为"wandb: error权限被拒绝访问wandb_entity/wandb_project_name/project_id“,并出现在网上:
model = run.file("agent.pt")全部产出如下:
wandb: Currently logged in as: elena (use `wandb login --relogin` to force relogin)
wandb: Tracking run with wandb version 0.12.15
wandb: Run data is saved locally in /home/elena/workspace/playground/cleanrl/wandb/run-20220424_180429-2moec0qp
wandb: Run `wandb offline` to turn off syncing.
wandb: Resuming run BreakoutNoFrameskip-v4__dqn-save__1__1650816268
wandb: ⭐ View project at https://wandb.ai/elena/test
wandb: View run at https://wandb.ai/elena/test/runs/2moec0qp
A.L.E: Arcade Learning Environment (version 0.7.4+069f8bd)
[Powered by Stella]
/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
warnings.warn(
wandb: ERROR Permission denied to access elena/test/2moec0qp
Traceback (most recent call last):
File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/wandb/sdk/lib/retry.py", line 102, in __call__
result = self._call_fn(*args, **kwargs)
File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/wandb/apis/public.py", line 2428, in download
util.download_file_from_url(path, self.url, Api().api_key)
File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/wandb/util.py", line 1197, in download_file_from_url
response.raise_for_status()
File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/requests/models.py", line 960, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api.wandb.ai/files/elena/test/2moec0qp/td_network.pt
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/wandb/apis/normalize.py", line 22, in wrapper
return func(*args, **kwargs)
File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/wandb/sdk/lib/retry.py", line 159, in wrapped_fn
return retrier(*args, **kargs)
File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/wandb/sdk/lib/retry.py", line 118, in __call__
if not check_retry_fn(e):
File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/wandb/util.py", line 877, in no_retry_auth
raise CommError(f"Permission denied to access {wandb.run.path}")
wandb.errors.CommError: Permission denied to access elena/test/2moec0qp
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "cleanrl/dqn_atari_save.py", line 184, in <module>
model.download(f"models/{args.exp_name}/")
File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/wandb/apis/normalize.py", line 58, in wrapper
raise CommError(message, err).with_traceback(sys.exc_info()[2])
File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/wandb/apis/normalize.py", line 22, in wrapper
return func(*args, **kwargs)
File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/wandb/sdk/lib/retry.py", line 159, in wrapped_fn
return retrier(*args, **kargs)
File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/wandb/sdk/lib/retry.py", line 118, in __call__
if not check_retry_fn(e):
File "/home/elena/anaconda3/envs/cleanrl/lib/python3.8/site-packages/wandb/util.py", line 877, in no_retry_auth
raise CommError(f"Permission denied to access {wandb.run.path}")
wandb.errors.CommError: Permission denied to access elena/test/2moec0qp
wandb: Waiting for W&B process to finish... (failed 1). Press Control-C to abort syncing.
wandb:
wandb:
wandb: Run history:
wandb: global_step ▁
wandb:
wandb: Run summary:
wandb: charts/episodic_return 0
wandb: charts/epsilon 0.01
wandb: charts/update 1969
wandb: global_step 0
wandb:
wandb: Synced BreakoutNoFrameskip-v4__dqn-save__1__1650816268: https://wandb.ai/elena/test/runs/2moec0qp
wandb: Synced 3 W&B file(s), 0 media file(s), 0 artifact file(s) and 1 other file(s)
wandb: Find logs at: ./wandb/run-20220424_180429-2moec0qp/logs因此,正如您所看到的,我已登录,我可以看到"https://wandb.ai/elena/test/runs/2moec0qp?workspace=user-elena"“下的文件,引起我注意的是"requests.exceptions.HTTPError: 404客户端错误:未找到url:https://api.wandb.ai/files/elena/test/2moec0qp/agent.pt"。这个路径看起来确实与https路径不同,但也许这不是问题所在?有什么想法吗?
发布于 2022-08-30 22:12:01
您试图访问的工件可能有不同的名称,或者运行可能不存在。
在我的情况下,我试图使用wandb Api下载一个模型。
file_name = "model.h5"
api = wandb.Api()
run = api.run(
entity/project/run_id
)
run.file(file_name).download()在这种情况下,我的错误是model_name应该是模型-beest.h5。
https://stackoverflow.com/questions/71990430
复制相似问题