0

I am very new to data science and jupyter lab. Until recently I used to work on Google Colaboratory, where I could run a piece of code close the colab tab and when I reopen the state of the execution would be intact.

For example, say I have a=10 and print(a) in another block. I run both these blocks, I close colab and reopen it. The output 10 is still there. Now if I add another block and run print(a+1) it would remember what I had saved in a and display 2. However, in jupyter lab, although the output are still there I am having to re-run everything from the beginning to add new codes. The actual context for which I am asking this question is not as simple and short as a=1, I am importing large datasets, fitting classifiers which takes way too long.

Is there a way I can achieve what I get with colab on jupyter lab only? I am running on just local host?

Thank you!

  • Have you looked into saving/loading models using utilities in the framework you are using? BTW, which framework are you using? – ephsmith Apr 17 '22 at 16:39
  • On colab were you paying for persistence or something? For how long could you close the tab & come back and the state still be intact? In general, if you are running something that you cannot tolerate starting with a `Run all` regularly, you probably don't want to be using a Jupyter notebook local only or you want to build in mechanisms like pickling to save the results of an 'expensive' calculation(s). It also sounds like if you are using your local computer, you expect to be able to shutdown your machine but retain a running kernel? – Wayne Apr 17 '22 at 21:50
  • I'd suggest looking how practitioners doing similar work to what you want to do handle long running code and the types of datasets you want to work with. They may have machines or HPCs they connect to from their local machines. Or powerful desktop machines they run non-stop? – Wayne Apr 17 '22 at 21:53
  • Does this answer your question? [How to pickle or store Jupyter (IPython) notebook session for later](https://stackoverflow.com/questions/34342155/how-to-pickle-or-store-jupyter-ipython-notebook-session-for-later) – krassowski Apr 18 '22 at 15:56

0 Answers0