English | 简体中文
- Answer:
The recommended configuration parameters of the model are stored in the yaml file of each model folder under PaddleSeg/configs. For example, one of the configurations of ANN is given in /PaddleSeg/configs/ann/ann_resnet50_os8_cityscapes_1024x512_80k.yml. As shown below:
The red part in the figure is the storage location of the pre-training model parameter file of the backbone network. Note: Here, we will download the pre-training model parameters provided by us directly in the form of a https link. If you have the pre-trained model parameters of the backbone network locally, please replace the
pretrained
underbackbone
in the yaml file with the absolute path. Or, you should set the relative path for the storage location of the pre-training model parameters according to the directory where thetrain.py
will be executed.
The green part in the figure is the storage location of the pre-training model parameter file of the segmentation network. If you have the pre-trained model parameters of the segmentation network locally, please replace the
pretrained
in the yaml file with the absolute path or relative path where it is stored.
- Answer:
The way to set the
epoch
will be affected by the size of the dataset. So we support setiters
.
Supplement: The relationship between training configuration parameters
-
Define the parameters as follows:
-
- Dataset size: N
-
- Batch size: batch_size
-
- Number of GPUs: num_gpus
-
- Total number of iterations: iters
-
-
Then:
- epoch = (iters * batch_size * num_gpus) / N
- Answer:
Since the configuration of data augmentation is specified in the yaml file, it's important to introduce the basic knowledge of the configuration file in PaddleSeg.
Cityscapes is one of the most commonly used datasets in the field of semantic segmentation, so some common configurations on Cityscapes have been given.
PaddleSeg uses
_base_
to specify the inheritance relationship between configurations:
_base_: '../_base_/cityscapes.yml'
_base_: '../_base_/cityscapes_1024x1024.yml'
- Instruction:
-
- Data augmentation is specified by
transforms
and loaded sequentially from top to bottom.
- Data augmentation is specified by
-
- The subclass overrides the configuration of the same name in its parent class.
-
- The command line (such as
--batch_size 4
) overwrites the configuration with the same name inside --config (such asbatch_size: 8
specified in yaml).
- The command line (such as
-
- Answer:
If you are using a custom dataset with inconsistent shapes, this may be an error caused by improper data augmentation loading sequence.
In Q3, we already know that PaddleSeg's data augmentation configuration is loaded in order.
For example,
RandomRotation
will change the size of the image. If it is set after other augmentations to correct the size (such as Crop, Resize), the image size will be inconsistent. This causes a DataLoader reader thread error.
Therefore, before starting training, please refer to Q3 to check the data augmentation configuration sequence.
- Answer:
The current SOTA model on CityScapes can reach 87% mIoU.
Please refer: https://github.com/PaddlePaddle/PaddleSeg/tree/develop/contrib/CityscapesSOTA
- Answer:
The
best_model
is obtained by evaluation and comparison during the training process.
Therefore, you need to enable the option
--do_eval
before training.
Q7: After resuming training, why does vdl only visualize the second half? How to visualize the interrupted half?
Due to some reasons, the model may not be trained at one time. A relatively simple method is: copy the contents of the first generated log and the second generated log to a new binary file, then read it.
We will support multiple log merging in the new version in the near future.
In addition, if it is similar to the situation of continuing training after interruption, you can specify the log name when calling visualdl, so that you can continue to write directly in the specified log file.