Skip to content
New issue

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

fail in reproducing the result of hover #169

Open
zhixiongzh opened this issue Aug 24, 2023 · 7 comments
Open

fail in reproducing the result of hover #169

zhixiongzh opened this issue Aug 24, 2023 · 7 comments
Labels
question Further information is requested

Comments

@zhixiongzh
Copy link

Hi,

I am running the provided example gym_pybullet_drones/examples/learn.py, but the agent failed to hover at the desired position.

Then I found the provided script is different from the paper then I git checkout master and run the experiments experiments/learning/singleagent.py but there are a lot of errors due to version conflict.

Is there any suggestion to train a good agent with gym_pybullet_drones/examples/learn.py in current main branch?

@RibhavOjha
Copy link

RibhavOjha commented Aug 28, 2023

@zhixiongzh I am getting exactly the same problem. learn.py doesn't hover properly and just crashes. When I run singleagent.py, it gives this error:

 File "C:\Users\Username\AppData\Roaming\Python\Python311\site-packages\torch\nn\modules\linear.py", line 96, in __init__
    self.weight = Parameter(torch.empty((out_features, in_features), **factory_kwargs))
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: empty() received an invalid combination of arguments - got (tuple, dtype=NoneType, device=NoneType), but expected one of:
 * (tuple of ints size, *, tuple of names names, torch.memory_format memory_format, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
 * (tuple of ints size, *, torch.memory_format memory_format, Tensor out, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)

Any updates?

@zhixiongzh
Copy link
Author

@RibhavOjha I only run the code in learn.py not the singleagent.py. I also have not yet reproduced the result using the example

@RibhavOjha
Copy link

@zhixiongzh are you also getting the same error as me for singleagent.py ?

@JacopoPan
Copy link
Member

Hi @zhixiongzh and @RibhavOjha

to reproduce the work in the paper you should checkout branches master or paper (and I am aware that some of the 3rd party dependencies are hardly maintained/backward compatible, unfortunately).

The current main/default branch is currently worked on to support SITL simulation and after that is done, I will re-introduce the learning examples (this time based on gymnasium and sb3 2.0).

@cyril-data
Copy link

I think you could get rid of this error :

 File "C:\Users\Username\AppData\Roaming\Python\Python311\site-packages\torch\nn\modules\linear.py", line 96, in __init__
    self.weight = Parameter(torch.empty((out_features, in_features), **factory_kwargs))
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: empty() received an invalid combination of arguments - got (tuple, dtype=NoneType, device=NoneType), but expected one of:
 * (tuple of ints size, *, tuple of names names, torch.memory_format memory_format, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)
 * (tuple of ints size, *, torch.memory_format memory_format, Tensor out, torch.dtype dtype, torch.layout layout, torch.device device, bool pin_memory, bool requires_grad)

By changing the onpolicy_kwargs in singleagent.py by this :

    # onpolicy_kwargs = dict(activation_fn=torch.nn.ReLU,
    #                        net_arch=[512, 512, dict(vf=[256, 128], pi=[256, 128])]
    #                        ) # or None
    onpolicy_kwargs = dict(activation_fn=torch.nn.ReLU,
                           net_arch=[512, 512, 256, 128]
                           )  # or None

But I face the same difficulty to reproduce the results with ppo and 1D (identical input to all motors) with RPMs ("one_d_rpm")...

@abdul-mannan-khan
Copy link

Same. I continued to run the training for 1E10. It did not work.

@JacopoPan
Copy link
Member

See #180 for the current status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants