MatplotLib output disappears on google colab (using google chrome)

Does this issue happen for anybody? I use Google Colab to open the notebooks provided for the course, using the “Open in colab” button. When I run any cell with a matplotlib plot show output, the plot appears for a brief second and then disappears. This doesn’t happen on my local jupyter notebook, but sadly my computer is not powerful enough to train the models on the local jupyter notebook. Any help here would be much appreciated. Thank you!

Hello @Swapneel_Bhatt
Welcome to our Community! Thanks for reaching out. We are here to help you.

Is the issue happening when you run another cell, or it’s just about time?

I recommend you use Matplotlib inline. It is a magic function in IPython; when you use the ‘inline’ backend, your matplotlib graphs will be included in your notebook, next to the code.

%matplotlib inline

Let me know if this works.
Happy New year

C2_W1_Lab_1_cats_vs_dogs.ipynb (29.9 KB)
Thanks for your answer! It usually always happens when running matplotlib output cells. I do have the %matplotlib inline code, since it’s already there in the ungraded lab notebook. I haven’t modified the notebook in any way

Hi @adonaivera
This line is there in the code, however it still doesnt work

Hi @Swapneel_Bhatt
I executed your code and can see all the graphs without any issues.

Maybe it is something with your browser; are you using Google chrome? Is any way that you can try with another browser?

PDT: Remove the notebook of the comments, please