Code Monkey home page Code Monkey logo

Comments (9)

stepanove avatar stepanove commented on May 28, 2024 1

@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.

stepanove avatar stepanove commented on May 28, 2024 1

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.

stepanove avatar stepanove commented on May 28, 2024

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.

sibocw avatar sibocw commented on May 28, 2024

We tried Colab last year when using a primitive version of this package for a course. We moved away from it because

  1. 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.
  2. We wanted the web page to be fully viewable (including videos) without the user having to run the code.
  3. 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.

sibocw avatar sibocw commented on May 28, 2024

@stepanove Thank you! Did you encounter this issue before? Was it also with Golab?

from flygym.

stepanove avatar stepanove commented on May 28, 2024

@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.

Снимок экрана от 2024-02-14 20-41-35

from flygym.

stepanove avatar stepanove commented on May 28, 2024

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.

sibocw avatar sibocw commented on May 28, 2024

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.

stepanove avatar stepanove commented on May 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.