当前位置:网站首页>Tencent cloud GPU best practices - remote development training using jupyter pycharm
Tencent cloud GPU best practices - remote development training using jupyter pycharm
2022-04-23 19:06:00 【Goose】
background
As an alchemy Engineer ,GPU There is no doubt that it will bring great efficiency improvement to our training model , However, the actual development is usually written locally and copied to GPU Running on the machine , In this way, there will be a certain reduction in efficiency , Moreover, maintaining two sets of environments at the same time may occasionally report errors . So why don't we go directly to GPU Develop directly on the machine ?
This paper will mainly describe several common remote development methods , There's always one for you .
- GPU Machine and environment preparation
- jupyter notebook long-range
- Local pycharm long-range jupyter Development
- long-range pycharm
1. GPU Machine and environment preparation
https://cloud.tencent.com/product/gpu
First, buy one GPU machine , Depending on the demand, you can choose computational or GPU Inferential ;
When choosing a mirror , If there is GPU Drive pre installation can be preferred , It can avoid the complicated process of installing the driver :
So I'm going to use GPU Computational +CentOS 7.6 As a demonstration :
without GPU Driver pre installation options , We had to install it manually , Refer to the following documents :
https://cloud.tencent.com/document/product/560/8048
https://cloud.tencent.com/developer/article/1835925
2. jupyter notebook long-range
Jupyter Notebook brief introduction
- Jupyter Notebook It's an open source Web application , Be similar to Web The notebook , We can use it to write code 、 The formula 、Markdown Explanatory text and drawings , And you can share the created documents .
- Jupyter Notebook The most convenient function is that it can run code in real time , And return the running result of the code segment , Support Visualization 、IDE Equal ability , It greatly improves the efficiency of model construction and analysis .
- At present, it has been widely used in data processing 、 The data simulation 、 Statistical modeling 、 Important areas of machine learning .
2.1 install
pip3 install jupyter
2.2 Generate a notebook The configuration file
jupyter notebook --generate-config
After execution, a configuration file will be generated , ~/.jupyter/jupyter_notebook_config.py
2.3 Set the password
$ jupyter notebook password
Enter password: ****
Verify password: ****
[NotebookPasswordApp] Wrote hashed password to ~/.jupyter/jupyter_notebook_config.json
2.4 Modify the configuration
modify jupyter_notebook_config.py
c.NotebookApp.ip='192.168.0.1'
c.NotebookApp.password = u'sha:ce... The ciphertext just copied '
c.NotebookApp.open_browser = False# Do not open the browser after starting the service
c.NotebookApp.port =8888 # You can specify a port , Use this port when accessing
The directory to use for notebooks and kernels.
c.NotebookApp.notebook_dir = '/'## Set the startup directory to /
2.5 Background operation
nohup jupyter notebook --allow-root > jupyter.log 2>&1 &
After starting , You can access the public network IP For remote development ( Remember to open it. GPU Machine network whitelist )
At this time to run notebook Is directly in GPU Run above , So don't worry about consuming local resources , There is no need to run locally and put it in GPU Tossed back and forth on the machine .
3. Local pycharm long-range jupyter Development
At this time, remote development has been realized , But it is estimated that many small partners will feel that they are very used to developing directly with web pages , period IDE Of hint, I don't know what method is in the library , How to call , At this time we can use IDEA pycharm Remote development .
1. First download pycharm pro ( The community version doesn't have jupyter function ) https://www.jetbrains.com/zh-cn/pycharm/
2. Get into pycharm after , Find... In the settings jupyter notebook The server , Select the second configured service and enter the external network in our first step jupyter link ;
3. In order to make GPU Server's Python lib The version is consistent with the local version , And the local can not download so many lib, We can configure remote python Interpreter : So the local machine even Python No need to install , Greatly liberate storage space ;
stay pycharm Set the distance from the item found Python Interpreter , Create a new interpreter , Input GPU Server public network IP And ssh Port for remote connection :
4. After setting up , You can use local pycharm Even on GPU Machine training developed ;
4. long-range pycharm
The last section , If there is a small partner who thinks it is necessary to install one locally pycharm, It takes up too much space , Is there any way to pycharm Don't use it ?
There is ,projector, Directly in GPU It's installed on the machine pycharm, long-range web Development ;
1. install python3、python3-pip:
yum install -y python3 python3-pip
2. Install dependency library files :
yum install libxext6 libxrender1 libxtst6 libfreetype6 libxi6
3. pip install projector
pip3 install --upgrade pip
pip3 install projector-installer
Each run projector Pre execution
export LC_ALL=en_US.utf-8
export LANG=en_US.utf-8
( Be careful : First run projector, May prompt projector : command not found, take /usr/local/bin/projector Add environment variables )
4. install pycharm
projector install
4. To configure projector
perform projector config edit Make configuration changes , add to projector -server service
5. function
projector run
Execution will generate URL, Change to public network IP After that, it can be developed remotely .
Ref
1. projector https://github.com/JetBrains/projector-installer
2. https://blog.jetbrains.com/zh-hans/blog/2021/03/25/projector-ide/
版权声明
本文为[Goose]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231853539927.html
边栏推荐
- 深入理解 Golang 中的 new 和 make 是什么, 差异在哪?
- : app: transformclasseswithrobustfordevrease meituan hot repair compilation error record
- Sentinel服务熔断实战(sentinel整合ribbon+openFeign+fallback)
- SSDB基础1
- 机器学习理论基础篇--关于机器学习的一些术语
- Partage de la conception de l'alimentation électrique de commutation et illustration des compétences en conception de l'alimentation électrique
- RPM包管理
- Download xshell 6 and xftp6 official websites
- Nacos as service registry
- std::stoi stol stoul stoll stof stod
猜你喜欢
Esp32 (UART receiving and sending) - receiving and sending communication of serial port (4)
The fifth bullet of MySQL learning -- detailed explanation of transaction and its operation characteristics
Using Visual Studio code to develop Arduino
Client interns of a large factory share their experience face to face
[record] typeerror: this getOptions is not a function
MVVM model
From technical system to business insight, the closing chapter of the practice of small and medium-sized R & D team structure
c#:泛型反射
MySQL Téléchargement et installation de la version Linux
Raspberry pie uses root operation, and the graphical interface uses its own file manager
随机推荐
SSDB基础3
SQL中函数 decode()与 replace()的用法
[记录]TypeError: this.getOptions is not a function
Some records used by VS2010
MySQL statement
中金财富怎么样?在上边开户安全吗
#yyds干货盘点#stringprep --- 因特网字符串预备
Zlib realizes streaming decompression
【历史上的今天】4 月 23 日:YouTube 上传第一个视频;网易云音乐正式上线;数字音频播放器的发明者出生
[record] typeerror: this getOptions is not a function
[today in history] April 23: the first video uploaded on YouTube; Netease cloud music officially launched; The inventor of digital audio player was born
8266 obtain 18b20 temperature
Click the input box to pop up the keyboard layout and move up
[mathematical modeling] - analytic hierarchy process (AHP)
How can programmers quickly develop high-quality code?
Nacos作为服务注册中心
os_ authent_ Prefix
Sentinel服务熔断实战(sentinel整合ribbon+openFeign+fallback)
Methods of nested recycleview to solve sliding conflict and incomplete item display
Loop path