Reputation: 1255
I am running a ML algorithm on image recognition dataset in AWS EC2 instance. The algorithm takes long time(>6) hours to run and I am not sure how to keep the instance up all this time.
I tried couple of times kicking off the code and see that connection is lost after an hour or so. How can I prevent this from happening.
To give more detail, I am running a Convolution neural network from jupyter notebook. I access this jupyter notebook from my local machine using port forwarding from AWS https://coderwall.com/p/ohk6cg/remote-access-to-ipython-notebooks-via-ssh#comment_28219
Thanks in advance
Upvotes: 0
Views: 675
Reputation: 7366
Try running your command (or code) in a screen. Refer https://www.rackaid.com/blog/linux-screen-tutorial-and-how-to/. This ensures that your command keeps running in the background even if the ssh connection drops. ssh again and open the screen.
Important commands:
screen -S <name> : creates the screen
screen -ls : list all screens
screen -r <name> : restore the screen
Upvotes: 2