linux将程序放置服务器后端运行,防止ssh链接中断

1、编写sh脚本

vim run.sh

#1 /bin/bash

export CUDA_VISIBLE_DAVICES=0  #指定0显卡

nohup python main.py &

2、将sh脚本变成可执行

chmod +x ./run.sh

3、运行脚本并查看输出

./run.sh   运行

tail -f nohup.out  查看最新打印信息

4、查看程序是否在0卡跑

nvidia-smi  或者 nvtop

猜你喜欢

转载自blog.csdn.net/zenglongjian/article/details/129969170
今日推荐