当前位置:网站首页>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
边栏推荐
猜你喜欢

Zero basics of C language lesson 8: Functions

Jenkins build prompt error: eacces: permission denied

9項規定6個嚴禁!教育部、應急管理部聯合印發《校外培訓機構消防安全管理九項規定》

从Celsius到三箭:加密百亿巨头们的多米诺,史诗级流动性的枯竭

Variable declaration of typescript

Stream常用操作以及原理探索

Self created notes (unique in the whole network, continuously updated)

Reprint - easy to use wechat applet UI component library

2021-10-09

Related knowledge of libsvm support vector machine
随机推荐
Exercise set 1
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
Cloudcompare - Poisson reconstruction
虫子 类和对象 中
Sword finger offer 45.61 Sort (simple)
Sword finger offer 40.41 Sort (medium)
Sword finger offer 21.57.58 I Double pointer (simple)
array
In insect classes and objects
AGCO AI frontier promotion (6.26)
SwiftUI找回丢失的列表视图(List)动画
Embedded virlog code running process
Knowledge about the determination coefficient R2 and the relationship with the correlation coefficient
[hcsd application development training camp] one line of code second cloud evaluation article - experience from the experiment process
Luogu p4513 xiaobaiguang Park
【HCSD应用开发实训营】一行代码秒上云评测文章—实验过程心得
永远不要使用Redis过期监听实现定时任务!
Related knowledge of libsvm support vector machine
虫子 运算符重载的一个好玩的
Wechat applet -picker component is repackaged and the disabled attribute is added -- below