记录一下gitHub跑项目的步骤 | 您所在的位置:网站首页 › 跑代码怎么跑 › 记录一下gitHub跑项目的步骤 |
1 在gitHub里下载了压缩包 2pycharm里面打开 3项目下新建虚拟环境env 步骤:file->setting->python interpreter->add->Virtualenv Environment
4 git 工具安装好 file->setting->python interpreter->tools->Terminal
5 使用Linux服务器的GPU,用到的工具Xshell
6 Linux 建立文件夹 第一步建文件夹:显示当前目录命令ll 进入主目录命令 cd /data 进入分目录命令 cd Username/ 创建文件夹命令 mkdir Username 同理Program, Data,Project 第二步安装miniconda,安装在Program并且设置环境变量:wget -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-4.7.10-Linux-x86_64.sh 下载命令(sample) chomd a+x Miniconda3-py37_4.9.2-Linux-86_64.sh 给所有用户给予文件可执行权限 bash Miniconda3-py37_4.9.2-Linux-86_64.sh 安装文件 将minicoda里面的python设置当前用户的全局变量: export PATH=/data/Lisa/Program/miniconda3/bin/python3.7$PATH 注意:
7连接Pycharm : Tools->Deployment->Configuration
8在使用GPU时,如果一张卡够用,没有多卡并行,使用以下代码: 具体可百度: import os os.environ["CUDA_VISIBLE_DEVICES"] = "2"# 2是GPU编号(四张卡一般是0,1,2,3) export P=/usr/local/cuda-11.1/bin:$PATH export LD_LIBRARY_PATH=/usr/local/cuda-11.1/lib64$LD_LIBRARY_PATH export PATH=/data/Lisa/Program/miniconda3/bin/python:$PATH export PYTHON_INCLUDE_PATH=/data/Lisa/Program/miniconda3/include/python3.7m:$PYTHON_INCLUDE_PATH
vim .bashrc nvidia-smi -l 看卡的型号来指定哪一张卡来加速
9 准备执行项目 sudo add-apt-repository ppa:djcj/hybri 安装ffempg 命令 ls 查看目录命令 pip3 install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html 安装pytorch的命令 python image_animation.py -i Inputs/trump2.png -c checkpoints/vox-cpk.pth.tar -v 1.mp4 执行命令 10 在xshell查看项目
11文件下载
下载服务器上的文件可以用这个软件 |
CopyRight 2018-2019 实验室设备网 版权所有 |