Open CottePutman opened 3 months ago
In the maddpg-pytorch README file I found that this code requires a specific fork of multiagent-particle-envs. By applying so the problem in utils/make_env.py/make_env()
can be fixed.
Also, ascp.shape[0] is fixed.
Introduction
I successfully run the code on Ubuntu 20.04 within the following environment:
Problems during the installation mostly occured on mujoco-py and to be honest there's just no way around it. Few tips I can offer is to stay patient and it will somehow work out :)
When running the code, thing gets stricker. I tried three
env_id
and only one managed to "output results". Here are the problems I came across and my solutions to it:Datasets
1. simple_tag / simple_world (didn't run out)
- In
algorithms/maddpg,py/init_from_env()
, line 453:However,
ascp
doesn't possess theshape[0]
attribute, which leads to IndexOutBounday exception (Also, code follows it comes up with access toacsp.high[0]
which would cause NoAttribute exception).I failed to find out the possible reasons by looking following the stack up to the
multiagent-particle-envs/multiagent/environment.py/__init__()
, where theenv
is created. So I guess it either involves version incompatibility of multiagent (but it only comes with one version 0.0.1 and that is the one installed), or the code might be modified to satisfy other datasets but those two.- In
utils/make_env.py/make_env()
:MultiAgentEnv()
doesn't have parameterdiscrete_action
, the implement of it only hasdiscrete_action_space
anddiscrete_action_input
, which is set True and False by default seperately. I have no idea but to simply delete the parameter and everything seems fine to me.2. HalfCheetah v2
I noticed that there are a few
if else
desinated to seperateHalfCheetah v2
apart from others, so I decided to give it a try. With the two modifcations above, I came across the following problem:In
algorithms/maddpg,py/update()
, line 257:This line will throw an exception about
ValueError: Expected parameter scale of distribution Normal to satisfy the constraint GreaterThan...
, which means this function can only take values that are larger than 0 as input but is called that way.The reference of
torch.distributions.Normal()
is put within afor
recycle and even I setself.omar_mu
andself.omar_sigma
to meet the requirement, it will throw the same exception right on the second recycle. Therefore, I triedtorch.clamp()
and it seems worked. Here is the modified code concerned:Notice: I have no idea how this could affect the code so be cautious when trying
Then the code was successfully running. Since there is no results outputing function I can only monitor the process in debug mode, eventually reached an eval_return of around 1800 in around 370k steps.
Hope this could help!