We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import ding, torch, sys print(ding.__version__, torch.__version__, sys.version, sys.platform)
v0.4.7 1.12.1+cpu 3.9.12 (main, Apr 4 2022, 05:22:27) [MSC v.1916 64 bit (AMD64)] win32
直接在Pycharm里面运行DI-engine\dizoo\gym_hybrid\config\gym_hybrid_pdqn_config.py报错:
DI-engine\dizoo\gym_hybrid\config\gym_hybrid_pdqn_config.py
Traceback (most recent call last): File "C:\Users\arche\code\repository\DI-engine\dizoo\gym_hybrid\config\gym_hybrid_pdqn_config.py", line 76, in <module> serial_pipeline([main_config, create_config], seed=0, max_env_step=int(1e7)) File "C:\Users\arche\code\repository\DI-engine\ding\entry\serial_entry.py", line 97, in serial_pipeline stop, eval_info = evaluator.eval(learner.save_checkpoint, learner.train_iter, collector.envstep) File "C:\Users\arche\code\repository\DI-engine\ding\worker\collector\interaction_serial_evaluator.py", line 314, in eval return_info = to_item(return_info) File "C:\Users\arche\code\repository\DI-engine\ding\torch_utils\data_helper.py", line 301, in to_item return [to_item(d) for d in data] File "C:\Users\arche\code\repository\DI-engine\ding\torch_utils\data_helper.py", line 301, in <listcomp> return [to_item(d) for d in data] File "C:\Users\arche\code\repository\DI-engine\ding\torch_utils\data_helper.py", line 303, in to_item return {k: to_item(v) for k, v in data.items()} File "C:\Users\arche\code\repository\DI-engine\ding\torch_utils\data_helper.py", line 303, in <dictcomp> return {k: to_item(v) for k, v in data.items()} File "C:\Users\arche\code\repository\DI-engine\ding\torch_utils\data_helper.py", line 299, in to_item return data.item() ValueError: only one element tensors can be converted to Python scalars
调试查看了一下 return_info 的信息:
return_info
[{'eval_episode_return': tensor([-1.2000]), 'action_args_mask': tensor([[1., 0.], [0., 1.], [0., 0.]])}, {'eval_episode_return': tensor([-1.2000]), 'action_args_mask': tensor([[1., 0.], [0., 1.], [0., 0.]])}, {'eval_episode_return': tensor([-1.2000]), 'action_args_mask': tensor([[1., 0.], [0., 1.], [0., 0.]])}, {'eval_episode_return': tensor([-1.2000]), 'action_args_mask': tensor([[1., 0.], [0., 1.], [0., 0.]])}, {'eval_episode_return': tensor([-1.2000]), 'action_args_mask': tensor([[1., 0.], [0., 1.], [0., 0.]])}]
是不是 to_item() 不支持多维的 tensor
to_item()
The text was updated successfully, but these errors were encountered:
fix(nyz): fix to_item compatibility bug (#646)
4c182f6
这个问题已经在最新的 main 分支 commit 中修复了,你可以看下你那边运行环境是否还存在该问题。
Sorry, something went wrong.
Ok, thanks.
No branches or pull requests
直接在Pycharm里面运行
DI-engine\dizoo\gym_hybrid\config\gym_hybrid_pdqn_config.py
报错:调试查看了一下
return_info
的信息:是不是
to_item()
不支持多维的 tensorThe text was updated successfully, but these errors were encountered: