agi-brain / xuance

XuanCe: A Comprehensive and Unified Deep Reinforcement Learning Library
https://xuance.readthedocs.io/
MIT License
657 stars 107 forks source link

NameError: name 'Toy_Env' is not defined #8

Open wulin0108 opened 1 year ago

wulin0108 commented 1 year ago

刘老师您好,我是一名多智能体强化学习的初学者,在尝试运行您发布的xuance框架时,选择的是tensorflow+gpu,遇到了如下报错, Traceback (most recent call last): File "C:\Users\50\Desktop\MADRLTEST\main.py", line 5, in is_test=False) File "F:\anaconda\envs\xpolicy\lib\site-packages\xuanpolicy\common\common_tools.py", line 121, in get_runner from xuanpolicy.tensorflow.runners import REGISTRY as run_REGISTRY File "F:\anaconda\envs\xpolicy\lib\site-packages\xuanpolicy\tensorflow\runners__init.py", line 1, in from .runner_drl import Runner_DRL as DRL_runner File "F:\anaconda\envs\xpolicy\lib\site-packages\xuanpolicy\tensorflow\runners\runner_drl.py", line 2, in from xuanpolicy.tensorflow.agents import get_total_iters File "F:\anaconda\envs\xpolicy\lib\site-packages\xuanpolicy\tensorflow\agents\init__.py", line 36, in from .policy_gradient.pdqn_agent import PDQN_Agent File "F:\anaconda\envs\xpolicy\lib\site-packages\xuanpolicy\tensorflow\agents\policy_gradient\pdqn_agent.py", line 6, in class PDQN_Agent(Agent): File "F:\anaconda\envs\xpolicy\lib\site-packages\xuanpolicy\tensorflow\agents\policy_gradient\pdqn_agent.py", line 12, in PDQN_Agent device: str = 'cpu'): NameError: name 'Toy_Env' is not defined 报错称这个toy_env没有得到定义,我不太清楚代码本身的含义,看到报错中的device: str = 'cpu'也尝试修改成了gpu,并没有起作用,请问我应该怎么修改代码?或者是否是我在环境安装的某个节点出现了问题? 恳请您百忙之中抽空查看我的问题,万分感谢!

wenzhangliu commented 1 year ago

您好,由于玄策近期正在进行版本更新,我们首先在PyTorch版玄策中进行功能更新,因此可能会遇到对TensorFlow或MindSpore不兼容的情况。我们建议您暂时先使用最新版的PyTorch版玄策来学习MARL,在接下来的时间里我们会尽快完成对TensorFlow和MindSpore的兼容。给您造成不变,非常抱歉。如有其它问题,欢迎随时联系!

wulin0108 commented 1 year ago

您好,由于玄策近期正在进行版本更新,我们首先在PyTorch版玄策中进行功能更新,因此可能会遇到对TensorFlow或MindSpore不兼容的情况。我们建议您暂时先使用最新版的PyTorch版玄策来学习MARL,在接下来的时间里我们会尽快完成对TensorFlow和MindSpore的兼容。给您造成不变,非常抱歉。如有其它问题,欢迎随时联系!

好的,感谢您的回复!