Linux deep Learning各种命令汇总

Ubuntu

172.18.32.248
192.168.143.248:6080
ssh node1

  1. CUDA_VISIBLE_DEVICES

  2. nvidia-smi

  3. sudo gedit ~/.bashrc

  4. source activate tensorflow
    conda list

  5. ifconfig -a
    192.168.143.204
    192.168.141.126

  6. conda install

    pip install --user

  7. 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 --set show_channel_urls yes

  8. import os
    os.environ[“CUDA_VISIBLE_DEVICES”] = “3”

  9. conda create -n venv2 python=3.6

[清华镜像](https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/)
bash Anaconda3-5.2.0-Linux-x86_64.sh
conda install tensorflow-gpu=1.14.0
conda install keras=2.2.4
pip install opencv-python
conda install matplotlib

conda install cudatoolkit=10.1.243
conda install cudnn=7.6.5
conda install matplotlib
conda install pytorch==1.0.0 torchvision==0.2.1 cuda90 -c pytorch
  1. anaconda search -t conda name
    anaconda show

  2. sudo su

  3. sudo gedit

  4. labelme_json_to_dataset <文件名>.json

  5. CUDA_VISIBLE_DEVICES=0 python train.py

  6. tensorboard --logdir=文件路径

  7. kill -9 PID

  8. 查看所有环境: conda info --envs

  9. 查看CUDA: nvcc -v

  10. 查看服务器地址:
    ifconfig

  11. 添加环境变量:
    vim ~/.bashrc
    or
    gedit ~/.bashrc
    source ~/.bashrc
    export PATH=/mnt/yuanshuo/anaconda3/bin:$PATH
    vim .bashrc可以对bashrc进行更改,任何可以用vim进行修改的内容,如果想退出编辑模式回到命令行界面,只需要先按Esc,然后输入
    如果是vi,则:Esc 退出编辑模式,输入以下命令:
    :wq 保存后退出vi,若为 :wq! 则为强制储存后退出(常用)

  12. 安装命令:bash Anaconda3-2020.07-Linux-x86_64.sh

  13. 新建文件夹:mkdir name
    删除文件夹:rm -r name

  14. vim . bash_profile

  15. #Tensorflow 按需分配内存
    gpu_options = tf.compat.v1.GPUOptions(allow_growth=True)
    sess = tf.compat.v1.Session(config=tf.compat.v1.ConfigProto(gpu_options=gpu_options))

added by Anaconda3 installer

export PATH="/mnt/shuoyuan/anaconda3/bin:$PATH"

export LD_LIBRARY_PATH= L D L I B R A R Y P A T H : / u s r / l o c a l / c u d a / l i b 64 e x p o r t P A T H = LD_LIBRARY_PATH:/usr/local/cuda/lib64 export PATH= LDLIBRARYPATH:/usr/local/cuda/lib64exportPATH=PATH:/usr/local/cuda/bin
export CUDA_HOME=/usr/local/cuda

export PATH=/media/yehao/常用软件/shuo/anaconda3/bin: P A T H e x p o r t L D L I B R A R Y P A T H = " / u s r / l o c a l / c u d a − 9.0 / l i b 64 : PATH export LD_LIBRARY_PATH="/usr/local/cuda-9.0/lib64: PATHexportLDLIBRARYPATH="/usr/local/cuda9.0/lib64:LD_LIBRARY_PATH"
export LIBRARY_PATH= L I B R A R Y P A T H : / u s r / l o c a l / c u d a − 9.0 / l i b 64 e x p o r t L D L I B R A R Y P A T H = LIBRARY_PATH:/usr/local/cuda-9.0/lib64 export LD_LIBRARY_PATH= LIBRARYPATH:/usr/local/cuda9.0/lib64exportLDLIBRARYPATH=LD_LIBRARY_PATH:/usr/local/cuda-9.0/extras/CUPTI/lib64
export PYTHONPATH=$PYTHONPATH:"/media/yehao/常用软件/shuo/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/contrib/slim/python:/media/yehao/常用软件/shuo/anaconda3/envs/tensorflow/lib/python3.6/site-packages/tensorflow/contrib/slim/python/slim/"

export PATH=//media/lxin/程序/anaconda3/bin: P A T H e x p o r t P A T H = / u s r / l o c a l / c u d a − 9.0 / b i n : PATH export PATH=/usr/local/cuda-9.0/bin: PATHexportPATH=/usr/local/cuda9.0/bin:PATH
export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64: L D L I B R A R Y P A T H e x p o r t L I B R A R Y P A T H = LD_LIBRARY_PATH export LIBRARY_PATH= LDLIBRARYPATHexportLIBRARYPATH=LIBRARY_PATH:/usr/local/cuda-9.0/lib64
export LD_LIBRARY_PATH= L D L I B R A R Y P A T H : / u s r / l o c a l / c u d a − 9.0 / e x t r a s / C U P T I / l i b 64 e x p o r t L D L I B R A R Y P A T H = / m e d i a / l x i n / 程 序 / a n a c o n d a 3 / l i b / : LD_LIBRARY_PATH:/usr/local/cuda-9.0/extras/CUPTI/lib64 export LD_LIBRARY_PATH=/media/lxin/程序/anaconda3/lib/: LDLIBRARYPATH:/usr/local/cuda9.0/extras/CUPTI/lib64exportLDLIBRARYPATH=/media/lxin//anaconda3/lib/:LD_LIBRARY_PATH
export PATH="/home/yuanshuo/.local/bin/labelme:KaTeX parse error: Expected 'EOF', got '#' at position 7: PATH" #̲PKG_CONFIG_PATH…PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
#export PKG_CONFIG_PATH

__conda_setup="$(’/media/yehao/常用软件1/shuo/anaconda3/bin/conda’ ‘shell.bash’ ‘hook’ 2> /dev/null)"
if [ ? − e q 0 ] ; t h e n e v a l " ? -eq 0 ]; then eval " ?eq0];theneval"__conda_setup"
else
if [ -f “/media/yehao/常用软件1/shuo/anaconda3/etc/profile.d/conda.sh” ]; then
. “/media/yehao/常用软件1/shuo/anaconda3/etc/profile.d/conda.sh”
else
export PATH="/media/yehao/常用软件1/shuo/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup

# <<< conda initialize <<<

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值