Comments (9)
@sibocw, I'll look into colab issue. I wanted to take a deeper look at this stuff but I didn't have a good cause :)
from flygym.
Nope, I meant that I wanted to get more familiar with Jupiter/Colab in general, I'm a C++ developer in a normal life :)
from flygym.
Maybe it makes sense to make the tutorials available in colab, just like MuJoCo does? It lowers the entry barrier significantly.
https://mujoco.readthedocs.io/en/latest/python.html#tutorial-notebook
from flygym.
We tried Colab last year when using a primitive version of this package for a course. We moved away from it because
- When using dm_control, running multiple simulations (even sequentially) caused the Colab runtime to crash due to some threading issue with the EGL renderer. We haven't encountered this problem on any other environment.
- We wanted the web page to be fully viewable (including videos) without the user having to run the code.
- It was very slow to run things on Colab that month for some reason (GPUs were scarce maybe?). I don't remember what happened exactly.
Regarding 1, I just tried it again and encountered the same issue. This notebook crashes the Colab runtime at the last cell. The following is the error stack:
Exception ignored in: <function MjrContext.__del__ at 0x7a65e2238e50>
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/dm_control/mujoco/wrapper/core.py", line 638, in __del__
File "/usr/local/lib/python3.10/dist-packages/dm_control/mujoco/wrapper/core.py", line 629, in free
File "/usr/lib/python3.10/contextlib.py", line 135, in __enter__
File "/usr/local/lib/python3.10/dist-packages/dm_control/_render/base.py", line 135, in make_current
RuntimeError: Cannot make context <dm_control._render.pyopengl.egl_renderer.EGLContext object at 0x7a65da5c9f00> current on thread <Thread(_colab_inspector_thread, started daemon 134578698184256)>: this context is already current on another thread <_MainThread(MainThread, started 134579582074880)>.
This only happens on the second simulation of the same notebook and only on Colab. It seem related to a "known issue with dm control" according to this issue, but the solution proposed there didn't seem immediately applicable to Colab.
So in the end we decided that it was not worth the effort, as we had a tight timeline for the course. Getting this to work could also be pretty nice.
from flygym.
@stepanove Thank you! Did you encounter this issue before? Was it also with Golab?
from flygym.
@sibocw, it looks like this exception doesn't really break anything (it says it's ignored). I had it few times but the video was generated anyway.
Here is my test notebok. It renders raw frames to ensure it doesn't show the video from previous run.
from flygym.
IMHO, an interactive tutorial is way better than just a web page. If I'm not involved into the process I just scroll it paying attention to videos only :)
btw, the size of the notebook with videos is just 5MB.
from flygym.
Hi @stepanove
it looks like this exception doesn't really break anything (it says it's ignored). I had it few times but the video was generated anyway.
Interesting! For me it certainly crashed the simulation because the whole Jupyter runtime crashed. I will try to look into this more.
IMHO, an interactive tutorial is way better than just a web page. If I'm not involved into the process I just scroll it paying attention to videos only :)
I totally agree. If Colab works we can at least provide a link to play with the tutorials on Colab (in any case, the notebook can be opened on Colab simply with the URL https://colab.research.google.com/github/xxx/xxx/xxx.ipynb
. Our notebooks are already on Github so this should be easy).
btw, the size of the notebook with videos is just 5MB.
My concern is that the videos might be updated and I don't want another 5MB of data to be tracked by Git every time the notebook changes. This is especially important because the package might be installed/cloned in ephemeral environments (Github Actions, or even Colab notebooks where the package needs to be reinstalled for every runtime).
from flygym.
My concern is that the videos might be updated and I don't want another 5MB of data to be tracked by Git every time the notebook changes. This is especially important because the package might be installed/cloned in ephemeral environments (Github Actions, or even Colab notebooks where the package needs to be reinstalled for every runtime).
Yep, I also think that storing videos in git (at least in the main package repo) is not good.
I heard github was going to add GPU enabled CI runners, then it can be used to execute notebooks and deploy the results somewhere.
from flygym.
Related Issues (20)
- Release checklist
- Bug in mask indicating whether visual input is refereshed at each step. HOT 1
- Remove randomness in visual renderinng HOT 9
- Refactor/clean the xml HOT 3
- Separate the NeuroMechFly class into an environment, fly class and potential other classes HOT 2
- In the long term, should we move away from dm_control and use just the mujoco binding for the core simulation?
- Increase modularity and facilitate inheritance
- Doc: Move docs for observation/action spaces to a separate page
- TODO: Main tasks for v1.0.0 HOT 1
- Merge new-api-grooming into dev-v1.0.0
- Fly-to-fly tracking: leading fly sinks underground HOT 1
- Discrepancies in contact force visualization
- Refactor flygym/examples HOT 1
- Make sure existing tutorials are consistent with the new API
- Add tutorial on plume tracking
- Add tutorial on connectome-constrained vision model
- Add tutorial on head stabilization
- Add tutorial on path integration
- Rendering doesn't work on Github Actions runners HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flygym.