From e9bfabe4340f205487ff486de6fb31d5441106b7 Mon Sep 17 00:00:00 2001 From: MengzhangLI Date: Fri, 29 Apr 2022 16:41:32 +0800 Subject: [PATCH] [Doc] Add more clearly statement of CPU training/inference (#1518) * [Doc] Add more clearly statement of CPU training/inference * Update docs/en/inference.md Co-authored-by: Miao Zheng <76149310+MeowZheng@users.noreply.github.com> --- docs/en/inference.md | 3 ++- docs/en/train.md | 2 +- docs/zh_cn/inference.md | 5 +++-- docs/zh_cn/train.md | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/en/inference.md b/docs/en/inference.md index cd6eaf0c1..1fc94ef9e 100644 --- a/docs/en/inference.md +++ b/docs/en/inference.md @@ -16,7 +16,8 @@ You can use the following commands to test a dataset. # single-gpu testing python tools/test.py ${CONFIG_FILE} ${CHECKPOINT_FILE} [--out ${RESULT_FILE}] [--eval ${EVAL_METRICS}] [--show] -# CPU: disable GPUs and run single-gpu testing script +# CPU: If GPU unavailable, directly running single-gpu testing command above +# CPU: If GPU available, disable GPUs and run single-gpu testing script export CUDA_VISIBLE_DEVICES=-1 python tools/test.py ${CONFIG_FILE} ${CHECKPOINT_FILE} [--out ${RESULT_FILE}] [--eval ${EVAL_METRICS}] [--show] diff --git a/docs/en/train.md b/docs/en/train.md index 8c47121c2..7c1c41184 100644 --- a/docs/en/train.md +++ b/docs/en/train.md @@ -37,7 +37,7 @@ If you want to specify the working directory in the command, you can add an argu #### Train with CPU -The process of training on the CPU is consistent with single GPU training. We just need to disable GPUs before the training process. +The process of training on the CPU is consistent with single GPU training if machine does not have GPU. If it has GPUs but not wanting to use it, we just need to disable GPUs before the training process. ```shell export CUDA_VISIBLE_DEVICES=-1 diff --git a/docs/zh_cn/inference.md b/docs/zh_cn/inference.md index b681dca2c..835872be9 100644 --- a/docs/zh_cn/inference.md +++ b/docs/zh_cn/inference.md @@ -15,8 +15,9 @@ # 单卡 GPU 测试 python tools/test.py ${配置文件} ${检查点文件} [--out ${结果文件}] [--eval ${评估指标}] [--show] -# CPU: 禁用 GPU 并运行单 GPU 测试脚本 -export CUDA_VISIBLE_DEVICES=-1 +# CPU: 如果机器没有 GPU, 则跟上述单卡 GPU 测试一致 +# CPU: 如果机器有 GPU, 那么先禁用 GPU 再运行单 GPU 测试脚本 +export CUDA_VISIBLE_DEVICES=-1 # 禁用 GPU python tools/test.py ${配置文件} ${检查点文件} [--out ${结果文件}] [--eval ${评估指标}] [--show] # 多卡GPU 测试 diff --git a/docs/zh_cn/train.md b/docs/zh_cn/train.md index 8e200b173..a54f28f03 100644 --- a/docs/zh_cn/train.md +++ b/docs/zh_cn/train.md @@ -27,7 +27,7 @@ python tools/train.py ${CONFIG_FILE} [可选参数] #### 使用 CPU 训练 -使用 CPU 训练的流程和使用单 GPU 训练的流程一致,我们仅需要在训练流程开始前禁用 GPU。 +如果计算机没有 GPU,那么使用 CPU 训练的流程和使用单 GPU 训练的流程一致。如果计算机有 GPU 但是想使用 CPU,我们仅需要在训练流程开始前禁用 GPU。 ```shell export CUDA_VISIBLE_DEVICES=-1