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

Running inside Google Colab #373

Closed
philwinder opened this issue Jun 27, 2019 · 1 comment

Comments

@philwinder
Copy link

commented Jun 27, 2019

I'm attempting to get SLM-Lab working inside a Google Colab instance. I can't get the getting started example working because of a torch error.

To Reproduce
Run this notebook

Error logs

Traceback (most recent call last):
  File "run_lab.py", line 77, in <module>
    mp.set_start_method('spawn')  # for distributed pytorch to work
  File "/usr/lib/python3.6/multiprocessing/context.py", line 242, in set_start_method
    raise RuntimeError('context has already been set')
RuntimeError: context has already been set

I think the solution is to add some exception handling around the mp.set_start_method('spawn') call, but I'm not certain about that.

Thanks!

@kengz

This comment has been minimized.

Copy link
Owner

commented Jun 29, 2019

We've never ran it on colab notebook, thanks for trying this out! Seem like the runtime is different than when running from a plain bash shell. I'll push a patch for this

btw, a way to use the optimized conda environment inside colab is to install following the SLM Lab README and run the conda and python command in one line:
!conda activate lab && python run_lab.py slm_lab/spec/demo.json dqn_cartpole dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.