question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Writing Tensorboard log files causes Google Colab runtime to crash.

See original GitHub issue

Describe the bug When running in a Google Colab, if a model is set up to write tensorboard, the runtime crashes after the first write out (typically in the call to model.learn()).

Code example Running the example for ppo2 (or any other algorithm) with the addition of the tensorbaord_log argument. E.g.

model = PPO2(MlpPolicy, env, verbose=1, tensorboard_log='./log')
model.learn(25000)  # Causes runtime to crash.

System Info Google Colab with dependencies installed as per the documented example Colab here.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12

github_iconTop GitHub Comments

2reactions
Charelvanhoofcommented, Feb 16, 2019

Hi Araffin,

You are right, in fact I already had it figured out in the past and your feedback triggered me to find it back. Leaving some notes for maybe helping other people

First run

!wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
!unzip ngrok-stable-linux-amd64.zip 

Next:

LOG_DIR = './PPO2_breakout_tensorboard/'
get_ipython().system_raw(
    'tensorboard --logdir {} --host 0.0.0.0 --port 6006 &'
    .format(LOG_DIR)
)

get_ipython().system_raw('./ngrok http 6006 &')

! curl -s http://localhost:4040/api/tunnels | python3 -c \
    "import sys, json; print(json.load(sys.stdin)['tunnels'][0]['public_url'])"

The link will bring you to the tensorboard.

1reaction
Charelvanhoofcommented, Nov 18, 2018

Found it: when you put it on accelerator = GPU (iso none). Then the last model.learn(2000) line crashes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Colab - Your session crashed for an unknown reason
Google Colab is crashing because you are trying to Run Code related to GPU with Runtime as CPU . The execution is successful...
Read more >
5 Google Colab Hacks One Should Be Aware Of
Here are some hacks and tricks that can enhance and streamline a user's experience with Google Colab, and also broaden their knowledge.
Read more >
[solved] Your session crashed after using all available RAM ...
so first let's talk about the problem. ... why? because we are loading all data at once.or generating all data at once. example...
Read more >
colab restart kernel | The AI Search Engine You Control
I just found out why it was happening. The colab runtime RAM was being consumed entirely while running through the last cell. It...
Read more >
Use TPUs | TensorFlow Core
Before you run this Colab notebook, make sure that your hardware accelerator is a TPU by checking your notebook settings: Runtime > Change...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found