Skip to content

Conversation

@shagunsodhani
Copy link
Contributor

@shagunsodhani shagunsodhani commented Aug 22, 2022

Description

Add a knowledge base to torchrl.
Main contribution in terms of diffs:

  • Add a file with description of common issues with rendering mujoco envs

Motivation and Context

Add a file with description of common issues with rendering mujoco envs.

  • I have raised an issue to propose this change (required for new features and bug fixes)

Types of changes

What types of changes does your code introduce? Remove all that do not apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds core functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • [ x] Documentation (update in the documentation)
  • Example (update in the folder of examples)

Checklist

Go over all the following points, and put an x in all the boxes that apply.
If you are unsure about any of these, don't hesitate to ask. We are here to help!

  • [ x] I have read the CONTRIBUTION guide (required)
  • [ x] My change requires a change to the documentation.
  • I have updated the tests accordingly (required for a bug fix or a new feature).
  • [ x] I have updated the documentation accordingly.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 22, 2022
Copy link
Collaborator

@vmoens vmoens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start
I made some comments.
I can also add errors that we had (pyopengl and such).
If you have any (might not be the case), referencing github threads when talking about an issue can also be useful (sometime the same error message has two or more different causes and the various solutions can be detailed in an issue somewhere out there).

2. Rendered images are completely black.

> Make sure to call `env.render()` before reading the pixels.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this for gym?
mujoco can be used with dm_control too. I guess we'd like to specify what lib is being used?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! Will update the name of the library

1. RuntimeError with error stack like this when running jobs using schedulers like slurm:

```
File "mjrendercontext.pyx", line 46, in mujoco_py.cymj.MjRenderContext.__init__
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not exist in the newest mujoco python bindings if i'm not wrong. Perhaps we could split this file in 'old' and 'new' mujoco bindings (they made a big revamp and it's probably worth splitting it according to the version).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, the more practical solution maybe to just add the mujoco version here. I havent run into this issue on newer Mujoco (and dont even want to 😛 )

@@ -0,0 +1,27 @@
## Common Issues when rendering Mujoco Environments
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about a general "all you need to know about MUJOCO" file? Something that would tell users how to install mujoco_py on machines with GPUs, how to choose between new and old bindings, etc?
I can help to fill the gaps of course.
Do we want to have a separate folder with issues and installation tips (rather than putting them in the root directory)? Here it's mujoco but we might have issues with other things (distributed, hydra, other third party libraries). I guess on the long term these things will live in the doc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to "all you need to know about MUJOCO". Also +1 to a separate folder. Maybe we can call it faq ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops saw it a bit late that you had renamed the folder to be knowledge_base already - sounds like a good name!

README.md Outdated
OS: macOS **** (x86_64)
```

We have documented some [common issues (and workarounds)](COMMON_MUJOCO_ISSUES.md) when rendering Mujoco environments.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to myself: if we decide to rename / move that file we have to change this

@vmoens vmoens changed the title Add a file with description of common issues with rendering mujoco envs [Doc] Add a file with description of common issues with rendering mujoco envs Aug 24, 2022
@vmoens
Copy link
Collaborator

vmoens commented Aug 24, 2022

We could also refer this
http://www.roboti.us/license.html
where there's a free activation key for the "old" mujoco

@vmoens
Copy link
Collaborator

vmoens commented Aug 30, 2022

@shagunsodhani I took the liberty of modifying the file, moving it to a separate directory and sketching a couple of other files too.
There is still some work that needs to be done but in general I think that having a knowledge base in torchrl for specific and general RL practical tips would be good!

If you'd have time to give it a look it would be fantastic!

@vmoens vmoens added the documentation Improvements or additions to documentation label Aug 31, 2022
Copy link
Contributor Author

@shagunsodhani shagunsodhani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@vmoens vmoens changed the title [Doc] Add a file with description of common issues with rendering mujoco envs [Doc] Add a knowledge base Sep 15, 2022
@vmoens vmoens merged commit 8c313c8 into pytorch:main Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants