1、Ubuntu中常用命令
nvidia-smi -l #显示机器上gpu的情况
1.1 tensorflow指定gpu的使用
在终端执行程序时指定GPU
CUDA_VISIBLE_DEVICES=1 python your_file.py
在Python代码中指定GPU
import os
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
参考:
https://blog.youkuaiyun.com/weixin_38208741/article/details/78715577
2、MATLAB调用python执行批量仿真
执行批量处理任务,调用MATLAB中系统函数system(),并返回输出结果。根据情况需要,在命令中加入环境变量。
system(['export PATH=' myPath ' ; ' command])
[status,cmdout] = system(command,'-echo')
参考:
https://ww2.mathworks.cn/help/matlab/ref/system.html
3、用shell脚本批量处理
常用命令
定义变量 your_name="qinjx" pwd=$(pwd)
<