当前位置:网站首页>Server create virtual environment run code
Server create virtual environment run code
2022-06-26 14:17:00 【AC doesn't know the depth】
Here's the catalog title
- One 、 Preface
- Two 、 Create a virtual environment to run code
- 1、 Connect to the server
- 2、 Creating a virtual environment
- 3、 Enter the virtual environment
- 4、 install cuda
- 5、 install PyTorch
- 6、 install Transformer
- 7、 install numpy
- 8、 install apex
- 9、 install opt-einusm
- 10、 install axial-attention
- 11、 install ujson
- 12、 install tqdm
- 13、 Run code
- 13、 Out of the environment
- 14、 View the current list of virtual environments
- 15、 Delete environment
One 、 Preface
I am busy running code on the server recently
Learn and accumulate some experience and skills
It is used to record and share with you
Two 、 Create a virtual environment to run code
I will use an example as a template , After learning , Delete again
Will not occupy everyone's server
1、 Connect to the server
For example, my connection method is :ssh -p Your number username-host
2、 Creating a virtual environment
Here I take one Code For example
Creating a virtual environment
conda create -n KDDocRE python==3.7.4
3、 Enter the virtual environment
conda activate KDDocRE
4、 install cuda
conda install cudatoolkit=10.2
If the speed is a little slow, you can consider replacing Tsinghua source
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes
5、 install PyTorch
Here are two ways to install
pip3 install torch torchvision torchaudio
perhaps
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch
Either way , But be sure to confirm your version number
Official website ad locum
6、 install Transformer
pip install transformers==4.8.2
Here's the reader's attention , If the third-party library is not followed by the version number
The latest version will be installed by default
If you have already installed another version
Consider installing the specified version again
Previous versions will be uninstalled automatically ( Figure 2 )
7、 install numpy
pip install numpy==1.19.4
8、 install apex
This third-party library is difficult to install
git clone https://github.com/NVIDIA/apex
cd apex
pip install -v --disable-pip-version-check --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./
If there is any error, please refer to this article article
9、 install opt-einusm
pip install opt_einsum==3.3.0
10、 install axial-attention
pip install axial_attention==0.6.1
11、 install ujson
pip install ujson
12、 install tqdm
pip install tqdm
13、 Run code
All the above environments have been configured
Next you can use pycharm Open the entire file
I still take the above project as an example
This is what it looks like when it's opened
And then use pycharm The remote connection server starts running code happily
Remote connection server Here
How to run the code
In general projects READ.md There will be introductions
13、 Out of the environment
conda deactivate
14、 View the current list of virtual environments
conda env list
15、 Delete environment
conda remove -n KDDocRE
So since , We have completed the environment creation , Run code , Delete environment and other operations
You can practice with your own projects
边栏推荐
- Wechat applet SetData dynamic variable value sorting
- Zero basics of C language lesson 7: break & continue
- How to check if a text field is empty or not in swift
- Common operation and Principle Exploration of stream
- C language | file operation and error prone points
- Global variable vs local variable
- "Scoi2016" delicious problem solution
- GEE——全球人类居住区网格数据 1975-1990-2000-2014
- How to convert data in cell cell into data in matrix
- d检查类型是指针
猜你喜欢
Sword finger offer 15.65.56 I 56Ⅱ. Bit operation (simple - medium)
服务器创建虚拟环境跑代码
基于PyTorch的生成对抗网络实战(7)——利用Pytorch搭建SGAN(Semi-Supervised GAN)生成手写数字并分类
9項規定6個嚴禁!教育部、應急管理部聯合印發《校外培訓機構消防安全管理九項規定》
Usage of unique function
A must for programmers, an artifact utools that can improve your work efficiency n times
Free machine learning dataset website (6300+ dataset)
9 regulations and 6 prohibitions! The Ministry of education and the emergency management department jointly issued the nine provisions on fire safety management of off campus training institutions
character constants
2021-10-09
随机推荐
2021-10-09
C language | Consortium
Postman自动化接口测试
使用 Performance 看看浏览器在做什么
Mathematical design D12 according to string function
Hard (magnetic) disk (I)
MySQL configuration improves data insertion efficiency
永远不要使用Redis过期监听实现定时任务!
9 articles, 6 interdits! Le Ministère de l'éducation et le Ministère de la gestion des urgences publient et publient conjointement neuf règlements sur la gestion de la sécurité incendie dans les établ
7.consul service registration and discovery
[cqoi2015] task query system
Basic type of typescript
Wechat applet - bind and prevent event bubble catch
SwiftUI找回丢失的列表视图(List)动画
Insect operator overloaded a fun
Comparison of disk partition modes (MBR and GPT)
Obtain information about hard disk and volume or partition (capacity, ID, volume label name, etc.)
BP neural network for prediction
【HCSD应用开发实训营】一行代码秒上云评测文章—实验过程心得
Introduction to granular computing