ElegantRL icon indicating copy to clipboard operation
ElegantRL copied to clipboard

tutorial_BipedalWalker_v3.ipynb 跑不通

Open xiezhipeng-git opened this issue 3 years ago • 3 comments

直接运行tutorial_BipedalWalker_v3.ipynb 报错

AttributeError Traceback (most recent call last) e:\study\machineStudy\project\matd3\ElegantRL\tutorial_BipedalWalker_v3.ipynb Cell 15 in <cell line: 1>() ----> 1 train_and_evaluate(args)

File e:\study\machineStudy\project\matd3\ElegantRL\elegantrl\train\run.py:91, in train_and_evaluate(args) 88 buffer = init_buffer(args, gpu_id) 89 evaluator = init_evaluator(args, gpu_id) ---> 91 agent.state = env.reset() 92 if args.if_off_policy: 93 trajectory = agent.explore_env(env, args.num_seed_steps * args.num_steps_per_episode)

AttributeError: 'NoneType' object has no attribute 'reset' 我试着使用args.env = build_env(env_func=args.env_func, env_args=args.env_args) 进行自己添加env参数。也会报其他错误。这个框架很好,模块都是分离的。要是有把各种算法环境都跑通。统一放进一个demo文件夹下就更好了。然后增加个mpe环境比较合适。多智能体的环境和demo太少

xiezhipeng-git avatar Sep 14 '22 16:09 xiezhipeng-git

@xiezhipeng-git Thanks for your reminder!

  1. We are currently working on the tutorial_BipedalWalker_v3.ipynb. This bug could be solved quickly.
  2. Besides, we will add MARL demos as soon as possible. Would you please help us test those demos after we update them?

shixun404 avatar Sep 14 '22 22:09 shixun404

@xiezhipeng-git tutorial_BipedalWalker_v3.ipynb has been solved by Pull Request #214 . Please let us know if you have any feedback or suggestions :)

shixun404 avatar Sep 15 '22 09:09 shixun404

@xiezhipeng-git感谢您的提醒!

  1. 我们目前正在开发_tutorial_BipedalWalker_v3.ipynb_。这个错误可以很快解决。
  2. 此外,我们将尽快添加 MARL 演示。您能帮助我们在更新这些演示后对其进行测试吗? @shixun404 1.更新后遇到了不一样的问题。下面是报错信息 2.我不一定一直会进行这个项目的测试啊,遇上了会试一下。有问题就报告

tutorial_BipedalWalker_v3.ipynb train_and_evaluate(args)

| Arguments Remove cwd: ./BipedalWalker-v3_PPO_0 Output exceeds the size limit. Open the full output data in a text editor

TypeError Traceback (most recent call last) e:\study\machineStudy\project\ElegantRL\ElegantRL\tutorial_BipedalWalker_v3.ipynb Cell 15 in <cell line: 1>() ----> 1 train_and_evaluate(args)

File e:\study\machineStudy\project\ElegantRL\ElegantRL\elegantrl\train\run.py:95, in train_and_evaluate(args) 92 env = build_env(args.env, args.env_func, args.env_args) 93 steps = 0 ---> 95 agent = init_agent(args, gpu_id, env) 96 buffer = init_buffer(args, gpu_id) 97 evaluator = init_evaluator(args, gpu_id)

File e:\study\machineStudy\project\ElegantRL\ElegantRL\elegantrl\train\run.py:24, in init_agent(args, gpu_id, env) 23 def init_agent(args: Arguments, gpu_id: int, env=None) -> AgentBase: ---> 24 agent = args.agent_class(args.net_dim, args.state_dim, args.action_dim, gpu_id=gpu_id, args=args) 25 agent.save_or_load_agent(args.cwd, if_save=False) 27 if env is not None:

File e:\study\machineStudy\project\ElegantRL\ElegantRL\elegantrl\agents\AgentPPO.py:40, in AgentPPO.init(self, net_dim, state_dim, action_dim, gpu_id, args) 38 self.cri_class = getattr(self, "cri_class", CriticPPO) 39 self.if_cri_target = getattr(args, "if_cri_target", False) ---> 40 AgentBase.init(self, net_dim, state_dim, action_dim, gpu_id, args) 42 self.ratio_clip = getattr( 43 args, "ratio_clip", 0.25 44 ) # could be 0.00 ~ 0.50 ratio.clamp(1 - clip, 1 + clip) ... --> 397 self.net = build_mlp_net(dims=[state_dim, *dims, action_dim]) 398 layer_init_with_orthogonal(self.net[-1], std=0.1) 400 self.action_std_log = nn.Parameter(torch.zeros((1, action_dim)), requires_grad=True)

TypeError: Value after * must be an iterable, not int

调试时看到dims 是16

xiezhipeng-git avatar Dec 30 '22 16:12 xiezhipeng-git