Problem:
I am running into an issue with my AWS EC2 instance where I am trying to ssh to the instance from both the mac terminal and Visual studio code. The ssh gets connected initially without any problem from the terminal & VS Code but when I try to edit one of the files and start running some script the ssh communication crashes completely. And this is repeating. This never happened for a certain amount of time until I started using VS Code to ssh into the instance :( This first happened when I tried to install some vscode extension onto the instance. but then could solve it by deleting vscode server extensions and folders on the EC2 instance referring from here.
Instance configuration:
- Type: t2.micro
- AMI: Deep Learning AMI GPU PyTorch 1.12.1 (Ubuntu 20.04) 20221005.
- Region: us-west-2
What I have tried:
- After going through the comments here, I checked if I was opening any large file or folder which could cause this issue but I am not doing that. I am trying to edit and run a python script that I have written which internally executes another script using this command
python3 /detect.py --weights weights/S-512.pt --source {path} --img-size 512 --conf-thres 0.6
in which the script is trying to access a folder called 'weights/' and it is the only folder that is considered a bit heavy with the size of 1.45 GB on disk.
- I tried stopping and starting the instance and could resolve the issue for a while, which is pretty obvious:sweat_smile: My opinion is that the script I am running is crashing my instance and the ssh connection is getting lost.
Do you think updating the instance type to a better one with more RAM can solve the issue? or do you think I shouldn't have VSCode at all?