-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[Doc] Update train test doc #2061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
docs/en/user_guides/4_train_test.md
Outdated
| # use the pre-trained model for the whole PSPNet | ||
| load_from = 'https://download.openmmlab.com/mmsegmentation/v0.5/pspnet/pspnet_r50-d8_512x1024_40k_cityscapes/pspnet_r50-d8_512x1024_40k_cityscapes_20200605_003338-2966598c.pth' # model path can be found in model zoo | ||
| ``` | ||
| ## Training and testing on a single machine with a single GPU |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| ## Training and testing on a single machine with a single GPU | |
| ## Training and testing on a single GPU |
docs/en/user_guides/4_train_test.md
Outdated
| MMSegmentation also provides out-of-the-box tools for training models. | ||
| This section will show how to train and test models on standard datasets. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines are a little weird and repeats with the last sentence。
docs/en/user_guides/4_train_test.md
Outdated
| Difference between `--resume` and `load-from`: | ||
| `--resume` loads both the model weights and optimizer status, and the iteration is also inherited from the specified checkpoint. | ||
| **Note:** Difference between the argument `--resume` and the field `load-from` in the config file: | ||
| `--resume` loads both the model weights and optimizer status and the iteration is also inherited from the specified checkpoint. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resume doesn't support load weights
docs/en/user_guides/4_train_test.md
Outdated
| `--resume` loads both the model weights and optimizer status and the iteration is also inherited from the specified checkpoint. | ||
| It is usually used for resuming the training process that is interrupted accidentally. | ||
|
|
||
| `load-from` only loads the model weights and the training iteration starts from 0. It is usually used for fine-tuning. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Note might not be required as resume doesn't support loading the specific checkpoint, and there might be confusion between resume and load_from.
docs/en/user_guides/4_train_test.md
Outdated
|
|
||
| - `--work-dir`: If specified, results will be saved in this directory. If not specified, the results will be automatically saved to `work_dirs/{CONFIG_NAME}`. | ||
| - `--show`: Show prediction results at runtime, available when `--show-dir` is not specified. | ||
| - `--show-dir`: If specified, the visualized segmentation mask will be saved in the specified directory. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 24 to 28 in 3388cfd
| parser.add_argument( | |
| '--show-dir', | |
| help='directory where painted images will be saved. ' | |
| 'If specified, it will be automatically saved ' | |
| 'to the work_dir/timestamp/show_dir') |
docs/en/user_guides/4_train_test.md
Outdated
| ### Launch multiple jobs on a single machine | ||
|
|
||
| If you launch multiple jobs on a single machine, e.g., 2 jobs of 4-GPU training on a machine with 8 GPUs, you need to specify different ports (29500 by default) for each job to avoid communication conflict. Otherwise, there will be an error message saying `RuntimeError: Address already in use`. | ||
| If you use `dist_train.sh` to launch training jobs, you can set the port in commands with the environment variable \`PORT\`\`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| If you use `dist_train.sh` to launch training jobs, you can set the port in commands with the environment variable \`PORT\`\`. | |
| If you use `dist_train.sh` to launch training jobs, you can set the port in commands with the environment variable `PORT`. |
docs/en/user_guides/4_train_test.md
Outdated
| **Note:** Difference between the argument `--resume` and the field `load-from` in the config file: | ||
|
|
||
| `load-from` only loads the model weights and the training iteration starts from 0. It is usually used for fine-tuning. | ||
| `--resume` only determines whether to resume from the latest checkpoint in the work_dir. It is usually used for resuming the training process that is interrupted accidentally. | ||
|
|
||
| ### Training on CPU | ||
| `load-from` will specify the checkpoint to be loaded and the training iteration starts from 0. It is usually used for fine-tuning. | ||
|
|
||
| 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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note:
If you would like to resume training from a specific checkpoint, you can use --resume with --cfg-options load-from=$CHECKPOINT.
* draft * refine structure * fix typo * rename single gpu title and redefine --resume * update introduction * add notes to load_from
* draft * refine structure * fix typo * rename single gpu title and redefine --resume * update introduction * add notes to load_from
* draft * refine structure * fix typo * rename single gpu title and redefine --resume * update introduction * add notes to load_from
Motivation
As title.
Modification
Update the structure: