Google Colab - How to 'restart runtime' using python code or command line interface?

后端 未结 3 1169
滥情空心
滥情空心 2020-12-31 15:09

Can someone suggest me programatically \'restart runtime\'? Any programmatically restarting option is fine, python or CLI (Command Line Interface), without using GUI.

3条回答
  •  再見小時候
    2020-12-31 16:04

    Run a cell with the following code snippet:

    import os
    os.kill(os.getpid(), 9)
    

    That will kill the current Python runtime process, which will be automatically restarted by the manager.

提交回复
热议问题