常用Linux命令

权限相关

  1. 给某个文件全部权限
  1. sudo chmod -R 777 ./dir***

一、Jupyter Notebook

1.1 配置远程访问

  1. 使用conda安装
  1. conda install jupyter notebook
  1. 生成配置文件
  1. jupyter notebook --generate-config
  1. 生成秘钥:输入ipython
  1. In [1]: from notebook.auth import passwd
  2. In [2]: passwd()
  1. 修改~/.jupyter/jupyter_notebook_config.py配置文件
  1. c.NotebookApp.password = 'sha1:1b4ea9662b35:3e3d6a823d264d466f125a0939623c05e7b66007'
  2. c.NotebookApp.ip='*'#×允许任何ip访问
  3. c.NotebookApp.open_browser = False
  4. c.NotebookApp.port =8888 #可自行指定一个端口, 访问时使用该端口

1.2 更换conda的Kernel

  1. 激活要更换的conda环境
  1. conda activate ENV_NAME
  1. 安装ipykernel
  1. conda install ipykernel
  1. 添加keranel
  1. python -m ipykernel install --user --name ENV_NAME --display-name "YOUR_NAME"

或者直接安装nb_nb_conda

  1. conda install nb_nb_conda

二、集群的使用

环境相关

  1. 使用最新的pat环境
  1. source ~/ ../share/platform/env/pat_latest
  1. 使用指定的pat环境
  1. source pat20200911
  1. pip安装,要在当前用户下安装
  1. pip install **** --user

集群任务

  1. srun提交任务脚本
  1. GPUS=1 GPUS_PER_NODE=1 ./tools/slurm_test.sh Pose test configs/mattors/dim/dim_stage3_v16_pln_1x1_1000k_comp1k.py work_dirs/dim_stage3/latest.pth
  1. 查看当前用户正在执行的任务
  1. swatch -l
  1. 查看当前任务队列
  1. squeue -p Pose
  1. 查看当前集群状态
  1. sinfo -p Pose
  1. matting脚本
    1. GPUS=1 GPUS_PER_NODE=1 ./tools/slurm_test.sh Pose EVE configs/mattors/fba/fba_comp1k.py work_dirs/fba/FBA_rename.pth