Skip to content
This repository has been archived by the owner on Sep 1, 2024. It is now read-only.

[Bug] Hopper-v2 crashing using MBPO #113

Closed
sufodsia opened this issue Jul 29, 2021 · 1 comment · Fixed by #116
Closed

[Bug] Hopper-v2 crashing using MBPO #113

sufodsia opened this issue Jul 29, 2021 · 1 comment · Fixed by #116
Labels
bug Something isn't working

Comments

@sufodsia
Copy link

Hi, I encountered a problem running Hopper-v2 with MBPO.

Steps to reproduce

run python -m mbrl.examples.main algorithm=mbpo overrides=mbpo_hopper device="cpu"

Observed Results

The code crashed, with the following error message:
File "/home/user/mbrl-lib/mbrl/env/termination_fns.py", line 19, in hopper *(next_obs[:, 1:] < 100).abs().all(-1)
RuntimeError: "abs_cpu" not implemented for 'Bool' Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.

I have tried to correct that bug by using np.abs() instead of .abs(), but then I met new error messages.
Thanks for considering my issue !

@sufodsia sufodsia added the bug Something isn't working label Jul 29, 2021
@luisenp
Copy link
Contributor

luisenp commented Jul 29, 2021

Thanks for reporting! Looks like a bug that comes from the original MBPO implementation, on which this is based. Looking at the gym code, the abs should be on the observation (not sure why the index is not the same).

I'm running training to see how it performs after this change, but the fix should be:

not_done = (
        torch.isfinite(next_obs).all(-1)
        * (next_obs[:, 1:].abs() < 100).all(-1)
        * (height > 0.7)
        * (angle.abs() < 0.2)
    )

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants