The specific operation process of cloud GPU (Hengyuan cloud [not recommended]) training

Introduction

This blog mainly talks about how to use the GPU on the cloud server to run the program, mainly about some settings and operation steps. For specific training steps, you can see my other blog.

There may be omissions in the following steps, or there may be some differences from yours. If you have any questions, please comment or private message.

Let me talk about the environment first , the computer operating system is win10, the cloud server platform uses Hengyuan Cloud, and the IDE uses the Pycharm professional version (version 2022.1.3, note that the community version cannot use the cloud server , students can apply for the professional version for free, specific steps Other blogs on CSDN describe in detail), the server operating system is Linux.

cloud platform

I chose Hengyuan Cloud before, but found that the revised version is getting more and more difficult to use. Now I have switched to autodl , and the price is quite cheap. The student party certification is a member. However, the documentation of autodl is not as easy to use as that of Hengyuan Cloud. ​​​​​​​​

Cloud platform operation

Select the GPU to be used

 The picture above is the cloud market interface, the left side can be used to filter GPU models, and the right side is available GPUs. It is divided into vouchers, high availability and activities, and the latter two require cash. This demonstration uses the voucher area to demonstrate.

The picture above is the interface after clicking rent, and there are specific introductions in the picture. It should be noted that if the image is the same but the GPU is different, the training will fail (I have encountered this problem, and the reason is not particularly clear, it may be a problem with the image).

After the instance is successfully created, open my instance and you can see the following interface. Here I will use the instance I created before to show it. Some basic information has been marked on the picture. The next step is to start the instance, turn it on through the instance management button, and rush.

? ? ? Question mark face (no more, no money, end here)

After looking at it, it suddenly became that you can only use real money to pay. Add another disadvantage, which is actually similar to the first disadvantage. The changes are too frequent. You can use the voucher for a while and then you can’t. Rented one again.

 

Ok, the lease is successful, the interface is as shown above after startup, and then configure pycharm.

pycharm configuration

Open the settings, click on the python interpreter, and add a new interpreter through the gear on the right (there are two ways to add a server, and the other is to operate through Tools/Tools in the menu bar)

ssh -p 45269 [email protected] The port number is 45269, the user name is root, the host is i-2.gpushare.com, fill in and click OK to connect.

Fill in the password, and remember to save the password for the next connection.

The python interpreter on the server is set by default, and the remote path is modified as follows. 

Note: It is recommended to upload the project manually (described below), and the remote path may need to be modified for the second time for automatic upload.

After the selection is complete, click OK, and then go to the next step without thinking.

The above interface appears, that is, the configuration is successful, click Apply and confirm.

After returning to the pycharm interface, you will see the picture above in the lower right corner of the bottom. The right side is the configured remote python interpreter, and the left side is the server. You need to make these two one-to-one correspondence. If they do not correspond, you can modify the server. Just click Revised to 45269.

After the server is set up successfully, the interpreter and the software package downloaded on the server will be updated in the background. If automatic upload is set, the code will also be automatically uploaded (if the data set is in the project, it will also be uploaded together, which will cause upload time It is very long, it is generally not recommended to upload data in this way, you can upload it through oss, see below)

 If automatic upload is not set, manually upload files to the server by right-clicking on the project root directory, as shown above. After the upload is successful, you can click jupyterlab to view the file through the Hengyuan Cloud web page.

You can see the uploaded files, because there is no data set, so the speed is very fast.

At this point, the pycharm configuration is basically completed.

data upload

 Hengyuan cloud data upload uses various methods such as oss, it is recommended to use oss to upload, first download oss ​​to the local.

 

 After the download is complete, open oss.exe, enter login to log in, enter the account number and password of Hengyuan Cloud, and the login is successful

Upload data, note that only compressed packages can be uploaded.

 Upload the DOTA dataset annotation file in the c drive to the DOTA folder in oss through the command in the above figure, as shown in the figure below.

Copy the dataset in the personal data directory to the /hy-tmp directory, through the terminal in pycharm or jupyterlab. Here is the terminal implementation of jupyterlab, first log in, and then copy the file to the hy-tmp directory through the command line, as shown in the figure below.

 Then create a directory mydata to store the decompressed files, and decompress the dataset to the mydata folder.

 So far, pycharm and the server are all configured. After modifying the code and uploading it to the server, you can click to run it in pycharm (note the environmental requirements in requirements.txt). If the program reports an error, you can read my other blog, it may be because of some settings or the package is not installed.

YOLOv7 uses cloud GPU to train its own dataset https://blog.csdn.net/weixin_43764678/article/details/125863456?spm=1001.2014.3001.5501

 If there are mistakes in the article, please let me know.

Guess you like

Origin blog.csdn.net/weixin_43764678/article/details/126029879