Because I need to use MAC Pro to run the deep learning code, but the running speed is too slow (when Anaconda has been used), I have to wait another night for each parameter adjustment, so I decided to use a server to do it.
Prerequisites for use:
- pychramProfessional versionhas been downloaded (students can get it for free)
- Alibaba Cloud has purchased GPU servers
When purchasing a cloud disk:
- A cloud disk must be available when creating an instance.
- If you need to connect to pychram, you need public IP4.
- Newbies are advised to use a password to log in to the instance.
process:
1. Enter the instance from the cloud server ECS and you can see all the information:
At the same time, you can install a Miniconda3 to facilitate subsequent configuration and use in different environments.
ssh root@ip address
wget https://mirrors.bfsu.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
#安装相对应的Python版本
source .bashrc
conda create -n test python=3.7 #其中test可以是任何的文件名
After installation, you can use pycharm to configure the interpreter.
1. Setting-Tools-SSH Configurations
Enter Host, Username and use password verification (or key verification)
I tried it and only the public network can be used here.
2. Setting-Project_name-Python Interpreter-Add Interpreter-On SSH
Then follow the requirements to the last step:
The path to the file is important! ! ! You must understand the logic behind it, otherwise you will easily get confused.
Base interpreter: The default location of Base interpreter is: root/miniconda3/bin/python, but because I created a new virtual environment in Miniconda3 before, I choose here: < /span> /root/miniconda3/envs/test/bin/python3.7
Sync folder: is the location where the files are stored in the GPU disk. If you do not select it, there should be a pychram_xx folder of tem when generating the interpreter
It should be noted that if you upload files to the temporary folder of temp, the files will disappear after restarting. So I usually choose to save it in another path, and I can manually upload separate files to the cloud server in advance or later:
System Interpreter: Here I kept the same settings as the Virtualenv Environment (I'm not sure about this). It is currently running smoothly.
Then click Create.
At this time, open Setting-Deployment and you can see the SSH file you just created. After creation, the information of these folders can still be modified. I usually modify the names of these SSH files to distinguish file projects.
upload files
Next, if the file is not uploaded, you can select some files and then tools-upload. After the code is run, if the file is generated, tools-download