当前位置: 首页 > AI > 文章内容页

基于paddleSeg的自定义遥感数据语义分割——以DLRSD为例

时间:2025-07-23    作者:游乐小编    

本文介绍基于PaddleSeg 2.1实现DLRSD遥感影像数据集语义分割的流程。先准备数据集,按自定义格式整理,划分训练、验证集。接着用OCRNet模型训练,迭代1000次,最佳mIoU达0.6823。测试采用增强模式,mIoU为0.6839,最后完成单张影像推理,展示结果。

基于paddleseg的自定义遥感数据语义分割——以dlrsd为例 - 游乐网

基于paddleSeg进行自定义遥感影像数据集的语义分割——以DLRSD为例

基于paddleseg 2.1使用自定义数据集DLRSD,其他遥感数据集实现训练、测试、推理脚本版任务

数据格式准备

DLRSD数据集

基于UCMerced_LandUse数据集进行标注标注了17种类型的遥感地物类型图像尺寸256 * 256 * 3图像数21* 100 = 2100gt格式,单通道8bit彩图,推荐使用PIL读取DLRSD详细数据信息

数据展示: 基于paddleSeg的自定义遥感数据语义分割——以DLRSD为例 - 游乐网 基于paddleSeg的自定义遥感数据语义分割——以DLRSD为例 - 游乐网        

PaddleSeg数据格式

paddleSeg支持CityScapes、ADE20K、Pascal VOC、自定义等数据集格式,paddleseg数据集配置链接

       

本文使用的是自定义数据格式:

数据存放在PaddleSeg/dataset/dlrsd文件夹下,影像、标注分别存储到image、gt下,train、val、test等部分按txt分别存储

           

文件结构:

    custom_dataset        |        |--images        |  |--image1.jpg        |  |--image2.jpg        |  |--...        |        |--labels        |  |--label1.jpg        |  |--label2.png        |  |--...        |        |--train.txt        |        |--val.txt        |        |--test.txt
登录后复制        

txt内容格式

images/image1.jpg labels/label1.pngimages/image2.jpg labels/label2.png...
登录后复制        

数据集配置文件可以参考设置如下:

train_dataset:  type: Dataset  dataset_root: custom_dataset  train_path: custom_dataset/train.txt  num_classes: 2  transforms:    - type: ResizeStepScaling      min_scale_factor: 0.5      max_scale_factor: 2.0      scale_step_size: 0.25    - type: RandomPaddingCrop      crop_size: [512, 512]    - type: RandomHorizontalFlip    - type: Normalize  mode: train
登录后复制    

项目准备

In [ ]
# paddleseg下载解压# 从gitee下载PaddleSeg!git clone https://gitee.com/paddlepaddle/PaddleSeg.git# 进入PaddleSeg目录%cd PaddleSeg# 切换到release/2.1分支!git checkout -b release/2.1 origin/release/2.1# 安装依赖!pip install -r requirements.txt
登录后复制        
fatal: destination path 'PaddleSeg' already exists and is not an empty directory./home/aistudio/PaddleSegfatal: Not a git repository (or any parent up to mount point /home/aistudio)Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simpleRequirement already satisfied: pre-commit in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from -r requirements.txt (line 1)) (1.21.0)Requirement already satisfied: yapf==0.26.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from -r requirements.txt (line 2)) (0.26.0)Requirement already satisfied: flake8 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from -r requirements.txt (line 3)) (4.0.1)Requirement already satisfied: pyyaml>=5.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from -r requirements.txt (line 4)) (5.1.2)Requirement already satisfied: visualdl>=2.0.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from -r requirements.txt (line 5)) (2.2.0)Requirement already satisfied: opencv-python in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from -r requirements.txt (line 6)) (4.1.1.26)Requirement already satisfied: tqdm in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from -r requirements.txt (line 7)) (4.36.1)Requirement already satisfied: filelock in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from -r requirements.txt (line 8)) (3.0.12)Requirement already satisfied: scipy in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from -r requirements.txt (line 9)) (1.6.3)Requirement already satisfied: prettytable in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from -r requirements.txt (line 10)) (0.7.2)Requirement already satisfied: six in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from pre-commit->-r requirements.txt (line 1)) (1.16.0)Requirement already satisfied: toml in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from pre-commit->-r requirements.txt (line 1)) (0.10.0)Requirement already satisfied: nodeenv>=0.11.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from pre-commit->-r requirements.txt (line 1)) (1.3.4)Requirement already satisfied: virtualenv>=15.2 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from pre-commit->-r requirements.txt (line 1)) (16.7.9)Requirement already satisfied: identify>=1.0.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from pre-commit->-r requirements.txt (line 1)) (1.4.10)Requirement already satisfied: importlib-metadata in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from pre-commit->-r requirements.txt (line 1)) (4.2.0)Requirement already satisfied: cfgv>=2.0.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from pre-commit->-r requirements.txt (line 1)) (2.0.1)Requirement already satisfied: aspy.yaml in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from pre-commit->-r requirements.txt (line 1)) (1.3.0)Requirement already satisfied: pycodestyle<2.9.0,>=2.8.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from flake8->-r requirements.txt (line 3)) (2.8.0)Requirement already satisfied: mccabe<0.7.0,>=0.6.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from flake8->-r requirements.txt (line 3)) (0.6.1)Requirement already satisfied: pyflakes<2.5.0,>=2.4.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from flake8->-r requirements.txt (line 3)) (2.4.0)Requirement already satisfied: flask>=1.1.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from visualdl>=2.0.0->-r requirements.txt (line 5)) (1.1.1)Requirement already satisfied: requests in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from visualdl>=2.0.0->-r requirements.txt (line 5)) (2.27.1)Requirement already satisfied: shellcheck-py in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from visualdl>=2.0.0->-r requirements.txt (line 5)) (0.7.1.1)Requirement already satisfied: bce-python-sdk in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from visualdl>=2.0.0->-r requirements.txt (line 5)) (0.8.53)Requirement already satisfied: protobuf>=3.11.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from visualdl>=2.0.0->-r requirements.txt (line 5)) (3.14.0)Requirement already satisfied: Flask-Babel>=1.0.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from visualdl>=2.0.0->-r requirements.txt (line 5)) (1.0.0)Requirement already satisfied: numpy in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from visualdl>=2.0.0->-r requirements.txt (line 5)) (1.20.3)Requirement already satisfied: matplotlib in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from visualdl>=2.0.0->-r requirements.txt (line 5)) (2.2.3)Requirement already satisfied: Pillow>=7.0.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from visualdl>=2.0.0->-r requirements.txt (line 5)) (7.1.2)Requirement already satisfied: pandas in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from visualdl>=2.0.0->-r requirements.txt (line 5)) (1.1.5)Requirement already satisfied: Werkzeug>=0.15 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from flask>=1.1.1->visualdl>=2.0.0->-r requirements.txt (line 5)) (0.16.0)Requirement already satisfied: itsdangerous>=0.24 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from flask>=1.1.1->visualdl>=2.0.0->-r requirements.txt (line 5)) (1.1.0)Requirement already satisfied: Jinja2>=2.10.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from flask>=1.1.1->visualdl>=2.0.0->-r requirements.txt (line 5)) (3.0.0)Requirement already satisfied: click>=5.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from flask>=1.1.1->visualdl>=2.0.0->-r requirements.txt (line 5)) (7.0)Requirement already satisfied: pytz in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from Flask-Babel>=1.0.0->visualdl>=2.0.0->-r requirements.txt (line 5)) (2024.1)Requirement already satisfied: Babel>=2.3 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from Flask-Babel>=1.0.0->visualdl>=2.0.0->-r requirements.txt (line 5)) (2.9.1)Requirement already satisfied: typing-extensions>=3.6.4 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from importlib-metadata->pre-commit->-r requirements.txt (line 1)) (4.1.1)Requirement already satisfied: zipp>=0.5 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from importlib-metadata->pre-commit->-r requirements.txt (line 1)) (3.7.0)Requirement already satisfied: pycryptodome>=3.8.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from bce-python-sdk->visualdl>=2.0.0->-r requirements.txt (line 5)) (3.9.9)Requirement already satisfied: future>=0.6.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from bce-python-sdk->visualdl>=2.0.0->-r requirements.txt (line 5)) (0.18.0)Requirement already satisfied: python-dateutil>=2.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from matplotlib->visualdl>=2.0.0->-r requirements.txt (line 5)) (2.8.2)Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from matplotlib->visualdl>=2.0.0->-r requirements.txt (line 5)) (3.0.7)Requirement already satisfied: cycler>=0.10 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from matplotlib->visualdl>=2.0.0->-r requirements.txt (line 5)) (0.10.0)Requirement already satisfied: kiwisolver>=1.0.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from matplotlib->visualdl>=2.0.0->-r requirements.txt (line 5)) (1.1.0)Requirement already satisfied: certifi>=2017.4.17 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from requests->visualdl>=2.0.0->-r requirements.txt (line 5)) (2024.10.8)Requirement already satisfied: idna<4,>=2.5 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from requests->visualdl>=2.0.0->-r requirements.txt (line 5)) (3.3)Requirement already satisfied: charset-normalizer~=2.0.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from requests->visualdl>=2.0.0->-r requirements.txt (line 5)) (2.0.12)Requirement already satisfied: urllib3<1.27,>=1.21.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from requests->visualdl>=2.0.0->-r requirements.txt (line 5)) (1.26.9)Requirement already satisfied: MarkupSafe>=2.0.0rc2 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from Jinja2>=2.10.1->flask>=1.1.1->visualdl>=2.0.0->-r requirements.txt (line 5)) (2.0.1)Requirement already satisfied: setuptools in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from kiwisolver>=1.0.1->matplotlib->visualdl>=2.0.0->-r requirements.txt (line 5)) (56.2.0)
登录后复制        

预修改的文件:

为正常运行网络模型,本项目已对以下文件进行修改,详情查看代码

PaddleSeg/configs/base/dlrsd.yml——(数据集配置文件)PaddleSeg/configs/unet/unet_dlrds.yml——(模型配置文件)PaddleSeg/ocrnet_dlrsd.yml——(ocrnet模型配置文件)work/img_copy.py——(文件拷贝代码)work/data_split.py——(数据划分代码)PaddleSeg/predict.py——(增加tif读取)

数据准备

In [ ]
# 文件解压!unzip -oq /home/aistudio/data/data55005/UCMerced_LandUse.zip -d /home/aistudio/data/image!unzip -oq /home/aistudio/data/data55005/DLRSD.zip  -d /home/aistudio/data/gt_color
登录后复制    In [ ]
# 数据预处理,将文件组织自定义数据集格式# image copy!python /home/aistudio/work/img_copy.py /home/aistudio/data/image/UCMerced_LandUse/Images /home/aistudio/PaddleSeg/dataset/dlrsd/image# gt copy!python /home/aistudio/work/img_copy.py /home/aistudio/data/gt_color/DLRSD/Images /home/aistudio/PaddleSeg/dataset/dlrsd/gt# dataset split!python /home/aistudio/work/data_split.py 0.8 0.2 0 /home/aistudio/PaddleSeg/dataset/dlrsd/image /home/aistudio/PaddleSeg/dataset/dlrsd/gt
登录后复制        
copy from /home/aistudio/data/image/UCMerced_LandUse/Images to /home/aistudio/PaddleSeg/dataset/dlrsd/image:agricultural finishairplane finishtenniscourt finishchaparral finishfreeway finishparkinglot finishmobilehomepark finishbuildings finishsparseresidential finishbaseballdiamond finishrunway finishdenseresidential finishbeach finishstoragetanks finishriver finishforest finishoverpass finishgolfcourse finishharbor finishintersection finishmediumresidential finishcopy from /home/aistudio/data/gt_color/DLRSD/Images to /home/aistudio/PaddleSeg/dataset/dlrsd/gt:agricultural finishairplane finishtenniscourt finishchaparral finishfreeway finishparkinglot finishmobilehomepark finishbuildings finishsparseresidential finishbaseballdiamond finishrunway finishdenseresidential finishbeach finishstoragetanks finishriver finishforest finishoverpass finishgolfcourse finishharbor finishintersection finishmediumresidential finishtotal 2100, split: train 1680 - 0.80 rate, val 420 - 0.20 rate, test 0 - 0.00 rate
登录后复制        

模型训练

参考paddleSeg

In [8]
# 模型训练, 其他超参数可参考paddleSeg,对unet_dlrds.yml进行修改# unet_dlrds.yml中的参数会覆盖dlrsd.yml中的参数,修改参数时,可以直接在unet_dlrds.yml中添加参数# !python train.py \#        --config configs/unet/unet_dlrsd.yml \#        --do_eval \#        --use_vdl \#        --save_interval 100 \#        --save_dir output# 使用精度更高的ocrnet进行训练, 可以尝试10000以上iter进行训练,得到更高精度!python train.py \       --batch_size 32 \       --iters 1000 \       --config ocrnet_dlrsd.yml \       --do_eval \       --use_vdl \       --save_interval 100 \       --save_dir output
登录后复制        
2024-04-14 12:18:35 [INFO]------------Environment Information-------------platform: Linux-4.13.0-36-generic-x86_64-with-debian-stretch-sidPython: 3.7.4 (default, Aug 13 2019, 20:35:49) [GCC 7.3.0]Paddle compiled with cuda: TrueNVCC: Cuda compilation tools, release 10.1, V10.1.243cudnn: 7.6GPUs used: 1CUDA_VISIBLE_DEVICES: NoneGPU: ['GPU 0: Tesla V100-SXM2-16GB']GCC: gcc (Ubuntu 7.5.0-3ubuntu1~16.04) 7.5.0PaddlePaddle: 2.1.2OpenCV: 4.1.1------------------------------------------------2024-04-14 12:18:35 [INFO]---------------Config Information---------------batch_size: 32iters: 1000loss:  coef:  - 1  - 0.4  types:  - ignore_index: 255    type: CrossEntropyLoss  - ignore_index: 255    type: CrossEntropyLosslr_scheduler:  end_lr: 0  learning_rate: 0.01  power: 0.9  type: PolynomialDecaymodel:  backbone:    pretrained: https://bj.bcebos.com/paddleseg/dygraph/hrnet_w18_ssld.tar.gz    type: HRNet_W18  backbone_indices:  - 0  num_classes: 18  type: OCRNetoptimizer:  momentum: 0.9  type: sgd  weight_decay: 4.0e-05train_dataset:  dataset_root: dataset/dlrsd  mode: train  num_classes: 18  train_path: dataset/dlrsd/train.txt  transforms:  - max_scale_factor: 2.0    min_scale_factor: 0.5    scale_step_size: 0.25    type: ResizeStepScaling  - crop_size:    - 256    - 256    type: RandomPaddingCrop  - type: RandomHorizontalFlip  - type: Normalize  type: Datasetval_dataset:  dataset_root: dataset/dlrsd  mode: val  num_classes: 18  transforms:  - type: Normalize  - target_size:    - 256    - 256    type: Resize  type: Dataset  val_path: dataset/dlrsd/val.txt------------------------------------------------W0414 12:18:35.587487   602 device_context.cc:404] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 11.0, Runtime API Version: 10.1W0414 12:18:35.587553   602 device_context.cc:422] device: 0, cuDNN Version: 7.6.2024-04-14 12:18:39 [INFO]Loading pretrained model from https://bj.bcebos.com/paddleseg/dygraph/hrnet_w18_ssld.tar.gz2024-04-14 12:18:40 [INFO]There are 1525/1525 variables loaded into HRNet./opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/framework.py:706: DeprecationWarning: `np.bool` is a deprecated alias for the builtin `bool`. To silence this warning, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here.Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations  elif dtype == np.bool:2024-04-14 12:18:47 [INFO][TRAIN] epoch: 1, iter: 10/1000, loss: 3.4345, lr: 0.009919, batch_cost: 0.6647, reader_cost: 0.03684, ips: 48.1407 samples/sec | ETA 00:10:582024-04-14 12:18:53 [INFO][TRAIN] epoch: 1, iter: 20/1000, loss: 2.7537, lr: 0.009829, batch_cost: 0.6197, reader_cost: 0.00049, ips: 51.6372 samples/sec | ETA 00:10:072024-04-14 12:18:59 [INFO][TRAIN] epoch: 1, iter: 30/1000, loss: 2.4857, lr: 0.009739, batch_cost: 0.5961, reader_cost: 0.00085, ips: 53.6849 samples/sec | ETA 00:09:382024-04-14 12:19:05 [INFO][TRAIN] epoch: 1, iter: 40/1000, loss: 2.2253, lr: 0.009648, batch_cost: 0.6049, reader_cost: 0.00106, ips: 52.8983 samples/sec | ETA 00:09:402024-04-14 12:19:11 [INFO][TRAIN] epoch: 1, iter: 50/1000, loss: 1.9626, lr: 0.009558, batch_cost: 0.5984, reader_cost: 0.00085, ips: 53.4791 samples/sec | ETA 00:09:282024-04-14 12:19:17 [INFO][TRAIN] epoch: 2, iter: 60/1000, loss: 1.8616, lr: 0.009467, batch_cost: 0.6030, reader_cost: 0.01686, ips: 53.0698 samples/sec | ETA 00:09:262024-04-14 12:19:23 [INFO][TRAIN] epoch: 2, iter: 70/1000, loss: 1.7680, lr: 0.009377, batch_cost: 0.5849, reader_cost: 0.00077, ips: 54.7057 samples/sec | ETA 00:09:042024-04-14 12:19:28 [INFO][TRAIN] epoch: 2, iter: 80/1000, loss: 1.6116, lr: 0.009286, batch_cost: 0.5890, reader_cost: 0.00095, ips: 54.3256 samples/sec | ETA 00:09:012024-04-14 12:19:35 [INFO][TRAIN] epoch: 2, iter: 90/1000, loss: 1.5829, lr: 0.009195, batch_cost: 0.6182, reader_cost: 0.00047, ips: 51.7606 samples/sec | ETA 00:09:222024-04-14 12:19:41 [INFO][TRAIN] epoch: 2, iter: 100/1000, loss: 1.5083, lr: 0.009104, batch_cost: 0.5941, reader_cost: 0.00166, ips: 53.8610 samples/sec | ETA 00:08:542024-04-14 12:19:41 [INFO]Start evaluating (total_samples: 420, total_iters: 420).../opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/math_op_patch.py:239: UserWarning: The dtype of left and right variables are not the same, left dtype is paddle.int32, but right dtype is paddle.bool, the right dtype will convert to paddle.int32  format(lhs_dtype, rhs_dtype, lhs_dtype))/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/math_op_patch.py:239: UserWarning: The dtype of left and right variables are not the same, left dtype is paddle.int64, but right dtype is paddle.bool, the right dtype will convert to paddle.int64  format(lhs_dtype, rhs_dtype, lhs_dtype))420/420 [==============================] - 60s 142ms/step - batch_cost: 0.1419 - reader cost: 3.9444e-2024-04-14 12:20:40 [INFO][EVAL] #Images: 420 mIoU: 0.3062 Acc: 0.6152 Kappa: 0.5491 2024-04-14 12:20:40 [INFO][EVAL] Class IoU: [0.     0.     0.2566 0.1382 0.4141 0.4006 0.3423 0.     0.9608 0.4201 0.0166 0.6178 0.2826 0.5871 0.15   0.     0.6299 0.294 ]2024-04-14 12:20:40 [INFO][EVAL] Class Acc: [0.     0.     0.4912 0.9435 0.4735 0.4704 0.3853 0.     1.     0.8808 0.086  0.6741 0.5215 0.85   0.1504 0.     0.6799 0.3236]2024-04-14 12:20:41 [INFO][EVAL] The model with the best validation mIoU (0.3062) was saved at iter 100.2024-04-14 12:20:47 [INFO][TRAIN] epoch: 3, iter: 110/1000, loss: 1.3279, lr: 0.009013, batch_cost: 0.5924, reader_cost: 0.01635, ips: 54.0138 samples/sec | ETA 00:08:472024-04-14 12:20:53 [INFO][TRAIN] epoch: 3, iter: 120/1000, loss: 1.2831, lr: 0.008922, batch_cost: 0.5966, reader_cost: 0.00139, ips: 53.6371 samples/sec | ETA 00:08:452024-04-14 12:20:59 [INFO][TRAIN] epoch: 3, iter: 130/1000, loss: 1.1546, lr: 0.008831, batch_cost: 0.6096, reader_cost: 0.00082, ips: 52.4938 samples/sec | ETA 00:08:502024-04-14 12:21:05 [INFO][TRAIN] epoch: 3, iter: 140/1000, loss: 1.2061, lr: 0.008740, batch_cost: 0.5993, reader_cost: 0.00117, ips: 53.3943 samples/sec | ETA 00:08:352024-04-14 12:21:11 [INFO][TRAIN] epoch: 3, iter: 150/1000, loss: 1.0794, lr: 0.008648, batch_cost: 0.5980, reader_cost: 0.00177, ips: 53.5158 samples/sec | ETA 00:08:282024-04-14 12:21:17 [INFO][TRAIN] epoch: 4, iter: 160/1000, loss: 1.0784, lr: 0.008557, batch_cost: 0.5858, reader_cost: 0.01779, ips: 54.6240 samples/sec | ETA 00:08:122024-04-14 12:21:23 [INFO][TRAIN] epoch: 4, iter: 170/1000, loss: 1.0746, lr: 0.008465, batch_cost: 0.5943, reader_cost: 0.00015, ips: 53.8473 samples/sec | ETA 00:08:132024-04-14 12:21:29 [INFO][TRAIN] epoch: 4, iter: 180/1000, loss: 1.0160, lr: 0.008374, batch_cost: 0.5921, reader_cost: 0.00016, ips: 54.0444 samples/sec | ETA 00:08:052024-04-14 12:21:35 [INFO][TRAIN] epoch: 4, iter: 190/1000, loss: 1.1226, lr: 0.008282, batch_cost: 0.5955, reader_cost: 0.00195, ips: 53.7374 samples/sec | ETA 00:08:022024-04-14 12:21:41 [INFO][TRAIN] epoch: 4, iter: 200/1000, loss: 1.1066, lr: 0.008190, batch_cost: 0.6310, reader_cost: 0.00169, ips: 50.7141 samples/sec | ETA 00:08:242024-04-14 12:21:41 [INFO]Start evaluating (total_samples: 420, total_iters: 420)...420/420 [==============================] - 61s 144ms/step - batch_cost: 0.1440 - reader cost: 4.2161e-02024-04-14 12:22:41 [INFO][EVAL] #Images: 420 mIoU: 0.5294 Acc: 0.7634 Kappa: 0.7237 2024-04-14 12:22:41 [INFO][EVAL] Class IoU: [0.     0.4053 0.4327 0.627  0.599  0.0673 0.7334 0.     0.9533 0.5389 0.5181 0.7464 0.4466 0.8169 0.552  0.6634 0.69   0.7388]2024-04-14 12:22:41 [INFO][EVAL] Class Acc: [0.     0.6584 0.5536 0.7176 0.7343 0.8204 0.7856 0.     0.9868 0.6825 0.7245 0.8834 0.8107 0.9022 0.5718 0.8478 0.7959 0.9131]2024-04-14 12:22:42 [INFO][EVAL] The model with the best validation mIoU (0.5294) was saved at iter 200.2024-04-14 12:22:48 [INFO][TRAIN] epoch: 5, iter: 210/1000, loss: 1.0923, lr: 0.008098, batch_cost: 0.5964, reader_cost: 0.01708, ips: 53.6531 samples/sec | ETA 00:07:512024-04-14 12:22:54 [INFO][TRAIN] epoch: 5, iter: 220/1000, loss: 1.0190, lr: 0.008005, batch_cost: 0.6013, reader_cost: 0.00018, ips: 53.2211 samples/sec | ETA 00:07:482024-04-14 12:23:00 [INFO][TRAIN] epoch: 5, iter: 230/1000, loss: 1.0221, lr: 0.007913, batch_cost: 0.5972, reader_cost: 0.00066, ips: 53.5837 samples/sec | ETA 00:07:392024-04-14 12:23:06 [INFO][TRAIN] epoch: 5, iter: 240/1000, loss: 0.9766, lr: 0.007821, batch_cost: 0.6007, reader_cost: 0.00062, ips: 53.2710 samples/sec | ETA 00:07:362024-04-14 12:23:12 [INFO][TRAIN] epoch: 5, iter: 250/1000, loss: 0.8989, lr: 0.007728, batch_cost: 0.6137, reader_cost: 0.00145, ips: 52.1419 samples/sec | ETA 00:07:402024-04-14 12:23:18 [INFO][TRAIN] epoch: 5, iter: 260/1000, loss: 0.9029, lr: 0.007635, batch_cost: 0.5650, reader_cost: 0.00090, ips: 56.6328 samples/sec | ETA 00:06:582024-04-14 12:23:24 [INFO][TRAIN] epoch: 6, iter: 270/1000, loss: 0.8537, lr: 0.007543, batch_cost: 0.6184, reader_cost: 0.01685, ips: 51.7439 samples/sec | ETA 00:07:312024-04-14 12:23:30 [INFO][TRAIN] epoch: 6, iter: 280/1000, loss: 0.8544, lr: 0.007450, batch_cost: 0.5992, reader_cost: 0.00116, ips: 53.4018 samples/sec | ETA 00:07:112024-04-14 12:23:36 [INFO][TRAIN] epoch: 6, iter: 290/1000, loss: 0.8475, lr: 0.007357, batch_cost: 0.5923, reader_cost: 0.00041, ips: 54.0301 samples/sec | ETA 00:07:002024-04-14 12:23:42 [INFO][TRAIN] epoch: 6, iter: 300/1000, loss: 0.7936, lr: 0.007264, batch_cost: 0.6050, reader_cost: 0.00058, ips: 52.8951 samples/sec | ETA 00:07:032024-04-14 12:23:42 [INFO]Start evaluating (total_samples: 420, total_iters: 420)...420/420 [==============================] - 60s 144ms/step - batch_cost: 0.1435 - reader cost: 4.1186e-02024-04-14 12:24:42 [INFO][EVAL] #Images: 420 mIoU: 0.5801 Acc: 0.7912 Kappa: 0.7568 2024-04-14 12:24:42 [INFO][EVAL] Class IoU: [0.     0.5324 0.4741 0.626  0.6086 0.5252 0.7589 0.007  0.9623 0.5803 0.491  0.7786 0.5816 0.9076 0.5717 0.616  0.6964 0.7239]2024-04-14 12:24:42 [INFO][EVAL] Class Acc: [0.     0.6716 0.7091 0.8305 0.8657 0.7009 0.8022 0.9908 0.9958 0.7105 0.5133 0.8871 0.7654 0.9173 0.6074 0.6626 0.7855 0.9062]2024-04-14 12:24:43 [INFO][EVAL] The model with the best validation mIoU (0.5801) was saved at iter 300.2024-04-14 12:24:49 [INFO][TRAIN] epoch: 6, iter: 310/1000, loss: 0.8334, lr: 0.007170, batch_cost: 0.6216, reader_cost: 0.00088, ips: 51.4776 samples/sec | ETA 00:07:082024-04-14 12:24:55 [INFO][TRAIN] epoch: 7, iter: 320/1000, loss: 0.8206, lr: 0.007077, batch_cost: 0.6054, reader_cost: 0.01669, ips: 52.8564 samples/sec | ETA 00:06:512024-04-14 12:25:02 [INFO][TRAIN] epoch: 7, iter: 330/1000, loss: 0.7791, lr: 0.006983, batch_cost: 0.6115, reader_cost: 0.00038, ips: 52.3275 samples/sec | ETA 00:06:492024-04-14 12:25:08 [INFO][TRAIN] epoch: 7, iter: 340/1000, loss: 0.7893, lr: 0.006889, batch_cost: 0.5994, reader_cost: 0.00075, ips: 53.3874 samples/sec | ETA 00:06:352024-04-14 12:25:14 [INFO][TRAIN] epoch: 7, iter: 350/1000, loss: 0.7701, lr: 0.006796, batch_cost: 0.5998, reader_cost: 0.00048, ips: 53.3533 samples/sec | ETA 00:06:292024-04-14 12:25:19 [INFO][TRAIN] epoch: 7, iter: 360/1000, loss: 0.7948, lr: 0.006702, batch_cost: 0.5912, reader_cost: 0.00020, ips: 54.1302 samples/sec | ETA 00:06:182024-04-14 12:25:25 [INFO][TRAIN] epoch: 8, iter: 370/1000, loss: 0.7359, lr: 0.006607, batch_cost: 0.5961, reader_cost: 0.01591, ips: 53.6839 samples/sec | ETA 00:06:152024-04-14 12:25:31 [INFO][TRAIN] epoch: 8, iter: 380/1000, loss: 0.7732, lr: 0.006513, batch_cost: 0.5958, reader_cost: 0.00133, ips: 53.7118 samples/sec | ETA 00:06:092024-04-14 12:25:37 [INFO][TRAIN] epoch: 8, iter: 390/1000, loss: 0.7243, lr: 0.006419, batch_cost: 0.6008, reader_cost: 0.00178, ips: 53.2630 samples/sec | ETA 00:06:062024-04-14 12:25:43 [INFO][TRAIN] epoch: 8, iter: 400/1000, loss: 0.7617, lr: 0.006324, batch_cost: 0.5974, reader_cost: 0.00041, ips: 53.5635 samples/sec | ETA 00:05:582024-04-14 12:25:43 [INFO]Start evaluating (total_samples: 420, total_iters: 420)...420/420 [==============================] - 60s 142ms/step - batch_cost: 0.1421 - reader cost: 3.9464e-02024-04-14 12:26:43 [INFO][EVAL] #Images: 420 mIoU: 0.6354 Acc: 0.8046 Kappa: 0.7733 2024-04-14 12:26:43 [INFO][EVAL] Class IoU: [0.     0.5345 0.4958 0.6375 0.6488 0.5401 0.7947 0.4412 0.9566 0.6051 0.5929 0.7681 0.6005 0.932  0.6718 0.6875 0.7183 0.812 ]2024-04-14 12:26:43 [INFO][EVAL] Class Acc: [0.     0.6217 0.6435 0.6767 0.799  0.7619 0.8421 0.7266 0.9952 0.7753 0.7934 0.917  0.7802 0.9715 0.7451 0.7686 0.8394 0.8891]2024-04-14 12:26:44 [INFO][EVAL] The model with the best validation mIoU (0.6354) was saved at iter 400.2024-04-14 12:26:50 [INFO][TRAIN] epoch: 8, iter: 410/1000, loss: 0.7373, lr: 0.006229, batch_cost: 0.5961, reader_cost: 0.00151, ips: 53.6830 samples/sec | ETA 00:05:512024-04-14 12:26:56 [INFO][TRAIN] epoch: 9, iter: 420/1000, loss: 0.6996, lr: 0.006134, batch_cost: 0.6003, reader_cost: 0.01966, ips: 53.3080 samples/sec | ETA 00:05:482024-04-14 12:27:02 [INFO][TRAIN] epoch: 9, iter: 430/1000, loss: 0.7439, lr: 0.006039, batch_cost: 0.6062, reader_cost: 0.00026, ips: 52.7906 samples/sec | ETA 00:05:452024-04-14 12:27:08 [INFO][TRAIN] epoch: 9, iter: 440/1000, loss: 0.8381, lr: 0.005944, batch_cost: 0.5920, reader_cost: 0.00020, ips: 54.0508 samples/sec | ETA 00:05:312024-04-14 12:27:14 [INFO][TRAIN] epoch: 9, iter: 450/1000, loss: 0.7520, lr: 0.005848, batch_cost: 0.5970, reader_cost: 0.00065, ips: 53.6005 samples/sec | ETA 00:05:282024-04-14 12:27:20 [INFO][TRAIN] epoch: 9, iter: 460/1000, loss: 0.8414, lr: 0.005753, batch_cost: 0.6021, reader_cost: 0.00129, ips: 53.1469 samples/sec | ETA 00:05:252024-04-14 12:27:26 [INFO][TRAIN] epoch: 10, iter: 470/1000, loss: 0.8407, lr: 0.005657, batch_cost: 0.5878, reader_cost: 0.01533, ips: 54.4415 samples/sec | ETA 00:05:112024-04-14 12:27:32 [INFO][TRAIN] epoch: 10, iter: 480/1000, loss: 0.7766, lr: 0.005561, batch_cost: 0.5939, reader_cost: 0.00088, ips: 53.8809 samples/sec | ETA 00:05:082024-04-14 12:27:38 [INFO][TRAIN] epoch: 10, iter: 490/1000, loss: 0.6825, lr: 0.005465, batch_cost: 0.6033, reader_cost: 0.00082, ips: 53.0438 samples/sec | ETA 00:05:072024-04-14 12:27:44 [INFO][TRAIN] epoch: 10, iter: 500/1000, loss: 0.6993, lr: 0.005369, batch_cost: 0.5977, reader_cost: 0.00220, ips: 53.5385 samples/sec | ETA 00:04:582024-04-14 12:27:44 [INFO]Start evaluating (total_samples: 420, total_iters: 420)...420/420 [==============================] - 60s 143ms/step - batch_cost: 0.1428 - reader cost: 4.3921e-2024-04-14 12:28:44 [INFO][EVAL] #Images: 420 mIoU: 0.6433 Acc: 0.8158 Kappa: 0.7854 2024-04-14 12:28:44 [INFO][EVAL] Class IoU: [0.     0.5429 0.4983 0.6943 0.6581 0.5558 0.8024 0.4723 0.9608 0.6045 0.5682 0.7844 0.6218 0.9213 0.6765 0.666  0.7303 0.8215]2024-04-14 12:28:44 [INFO][EVAL] Class Acc: [0.     0.5851 0.7199 0.7802 0.8013 0.7535 0.8533 0.7028 0.9982 0.7434 0.768  0.898  0.7861 0.9472 0.7861 0.7684 0.8051 0.9003]2024-04-14 12:28:45 [INFO][EVAL] The model with the best validation mIoU (0.6433) was saved at iter 500.2024-04-14 12:28:51 [INFO][TRAIN] epoch: 10, iter: 510/1000, loss: 0.7007, lr: 0.005272, batch_cost: 0.6111, reader_cost: 0.00197, ips: 52.3652 samples/sec | ETA 00:04:592024-04-14 12:28:56 [INFO][TRAIN] epoch: 10, iter: 520/1000, loss: 0.6916, lr: 0.005175, batch_cost: 0.5682, reader_cost: 0.00144, ips: 56.3156 samples/sec | ETA 00:04:322024-04-14 12:29:03 [INFO][TRAIN] epoch: 11, iter: 530/1000, loss: 0.6765, lr: 0.005078, batch_cost: 0.6610, reader_cost: 0.01684, ips: 48.4102 samples/sec | ETA 00:05:102024-04-14 12:29:09 [INFO][TRAIN] epoch: 11, iter: 540/1000, loss: 0.7006, lr: 0.004981, batch_cost: 0.6011, reader_cost: 0.00060, ips: 53.2397 samples/sec | ETA 00:04:362024-04-14 12:29:15 [INFO][TRAIN] epoch: 11, iter: 550/1000, loss: 0.6693, lr: 0.004884, batch_cost: 0.5991, reader_cost: 0.00319, ips: 53.4166 samples/sec | ETA 00:04:292024-04-14 12:29:21 [INFO][TRAIN] epoch: 11, iter: 560/1000, loss: 0.6371, lr: 0.004786, batch_cost: 0.6081, reader_cost: 0.00075, ips: 52.6256 samples/sec | ETA 00:04:272024-04-14 12:29:27 [INFO][TRAIN] epoch: 11, iter: 570/1000, loss: 0.6714, lr: 0.004688, batch_cost: 0.5879, reader_cost: 0.00069, ips: 54.4316 samples/sec | ETA 00:04:122024-04-14 12:29:33 [INFO][TRAIN] epoch: 12, iter: 580/1000, loss: 0.6552, lr: 0.004590, batch_cost: 0.5979, reader_cost: 0.01576, ips: 53.5168 samples/sec | ETA 00:04:112024-04-14 12:29:39 [INFO][TRAIN] epoch: 12, iter: 590/1000, loss: 0.7032, lr: 0.004492, batch_cost: 0.5926, reader_cost: 0.00015, ips: 53.9954 samples/sec | ETA 00:04:022024-04-14 12:29:45 [INFO][TRAIN] epoch: 12, iter: 600/1000, loss: 0.6684, lr: 0.004394, batch_cost: 0.5981, reader_cost: 0.00088, ips: 53.5068 samples/sec | ETA 00:03:592024-04-14 12:29:45 [INFO]Start evaluating (total_samples: 420, total_iters: 420)...420/420 [==============================] - 60s 142ms/step - batch_cost: 0.1415 - reader cost: 4.0659e-02024-04-14 12:30:44 [INFO][EVAL] #Images: 420 mIoU: 0.6476 Acc: 0.8181 Kappa: 0.7884 2024-04-14 12:30:44 [INFO][EVAL] Class IoU: [0.     0.5753 0.5149 0.6874 0.6624 0.5632 0.8085 0.4147 0.9513 0.6158 0.6408 0.7854 0.6181 0.9192 0.6675 0.6941 0.7279 0.8105]2024-04-14 12:30:44 [INFO][EVAL] Class Acc: [0.     0.7804 0.685  0.7804 0.806  0.7368 0.8634 0.8568 0.989  0.7441 0.7843 0.9157 0.8449 0.9835 0.7029 0.7389 0.8188 0.874 ]2024-04-14 12:30:45 [INFO][EVAL] The model with the best validation mIoU (0.6476) was saved at iter 600.2024-04-14 12:30:51 [INFO][TRAIN] epoch: 12, iter: 610/1000, loss: 0.6927, lr: 0.004295, batch_cost: 0.6133, reader_cost: 0.00106, ips: 52.1739 samples/sec | ETA 00:03:592024-04-14 12:30:57 [INFO][TRAIN] epoch: 12, iter: 620/1000, loss: 0.6416, lr: 0.004196, batch_cost: 0.5878, reader_cost: 0.00156, ips: 54.4372 samples/sec | ETA 00:03:432024-04-14 12:31:03 [INFO][TRAIN] epoch: 13, iter: 630/1000, loss: 0.6696, lr: 0.004097, batch_cost: 0.5937, reader_cost: 0.01762, ips: 53.9003 samples/sec | ETA 00:03:392024-04-14 12:31:10 [INFO][TRAIN] epoch: 13, iter: 640/1000, loss: 0.6738, lr: 0.003997, batch_cost: 0.6349, reader_cost: 0.00130, ips: 50.4020 samples/sec | ETA 00:03:482024-04-14 12:31:16 [INFO][TRAIN] epoch: 13, iter: 650/1000, loss: 0.6204, lr: 0.003897, batch_cost: 0.5997, reader_cost: 0.00070, ips: 53.3608 samples/sec | ETA 00:03:292024-04-14 12:31:22 [INFO][TRAIN] epoch: 13, iter: 660/1000, loss: 0.5943, lr: 0.003797, batch_cost: 0.5970, reader_cost: 0.00115, ips: 53.6006 samples/sec | ETA 00:03:222024-04-14 12:31:28 [INFO][TRAIN] epoch: 13, iter: 670/1000, loss: 0.6692, lr: 0.003697, batch_cost: 0.5999, reader_cost: 0.00095, ips: 53.3394 samples/sec | ETA 00:03:172024-04-14 12:31:33 [INFO][TRAIN] epoch: 14, iter: 680/1000, loss: 0.6299, lr: 0.003596, batch_cost: 0.5912, reader_cost: 0.01579, ips: 54.1238 samples/sec | ETA 00:03:092024-04-14 12:31:40 [INFO][TRAIN] epoch: 14, iter: 690/1000, loss: 0.6693, lr: 0.003495, batch_cost: 0.6100, reader_cost: 0.00082, ips: 52.4570 samples/sec | ETA 00:03:092024-04-14 12:31:46 [INFO][TRAIN] epoch: 14, iter: 700/1000, loss: 0.6149, lr: 0.003394, batch_cost: 0.5998, reader_cost: 0.00157, ips: 53.3538 samples/sec | ETA 00:02:592024-04-14 12:31:46 [INFO]Start evaluating (total_samples: 420, total_iters: 420)...420/420 [==============================] - 60s 143ms/step - batch_cost: 0.1428 - reader cost: 4.3040e-02024-04-14 12:32:46 [INFO][EVAL] #Images: 420 mIoU: 0.6746 Acc: 0.8354 Kappa: 0.8078 2024-04-14 12:32:46 [INFO][EVAL] Class IoU: [0.     0.5989 0.5554 0.7251 0.6605 0.575  0.8147 0.4845 0.96   0.631 0.6657 0.799  0.7254 0.9374 0.6921 0.7311 0.7419 0.8457]2024-04-14 12:32:46 [INFO][EVAL] Class Acc: [0.     0.807  0.7245 0.8534 0.7856 0.7607 0.8763 0.7907 0.9987 0.7856 0.7755 0.8704 0.8246 0.9818 0.7645 0.7729 0.8567 0.9267]2024-04-14 12:32:46 [INFO][EVAL] The model with the best validation mIoU (0.6746) was saved at iter 700.2024-04-14 12:32:52 [INFO][TRAIN] epoch: 14, iter: 710/1000, loss: 0.7421, lr: 0.003292, batch_cost: 0.5968, reader_cost: 0.00117, ips: 53.6205 samples/sec | ETA 00:02:532024-04-14 12:32:58 [INFO][TRAIN] epoch: 14, iter: 720/1000, loss: 0.6546, lr: 0.003190, batch_cost: 0.5940, reader_cost: 0.00032, ips: 53.8741 samples/sec | ETA 00:02:462024-04-14 12:33:04 [INFO][TRAIN] epoch: 15, iter: 730/1000, loss: 0.5932, lr: 0.003088, batch_cost: 0.5865, reader_cost: 0.01657, ips: 54.5621 samples/sec | ETA 00:02:382024-04-14 12:33:10 [INFO][TRAIN] epoch: 15, iter: 740/1000, loss: 0.5941, lr: 0.002985, batch_cost: 0.5966, reader_cost: 0.00024, ips: 53.6345 samples/sec | ETA 00:02:352024-04-14 12:33:16 [INFO][TRAIN] epoch: 15, iter: 750/1000, loss: 0.6004, lr: 0.002882, batch_cost: 0.6279, reader_cost: 0.00230, ips: 50.9615 samples/sec | ETA 00:02:362024-04-14 12:33:23 [INFO][TRAIN] epoch: 15, iter: 760/1000, loss: 0.6031, lr: 0.002779, batch_cost: 0.6034, reader_cost: 0.00289, ips: 53.0347 samples/sec | ETA 00:02:242024-04-14 12:33:28 [INFO][TRAIN] epoch: 15, iter: 770/1000, loss: 0.6118, lr: 0.002675, batch_cost: 0.5960, reader_cost: 0.00167, ips: 53.6929 samples/sec | ETA 00:02:172024-04-14 12:33:34 [INFO][TRAIN] epoch: 15, iter: 780/1000, loss: 0.6142, lr: 0.002570, batch_cost: 0.5754, reader_cost: 0.00081, ips: 55.6109 samples/sec | ETA 00:02:062024-04-14 12:33:40 [INFO][TRAIN] epoch: 16, iter: 790/1000, loss: 0.5906, lr: 0.002465, batch_cost: 0.6159, reader_cost: 0.01718, ips: 51.9571 samples/sec | ETA 00:02:092024-04-14 12:33:46 [INFO][TRAIN] epoch: 16, iter: 800/1000, loss: 0.5972, lr: 0.002360, batch_cost: 0.6070, reader_cost: 0.00100, ips: 52.7145 samples/sec | ETA 00:02:012024-04-14 12:33:46 [INFO]Start evaluating (total_samples: 420, total_iters: 420)...420/420 [==============================] - 60s 143ms/step - batch_cost: 0.1431 - reader cost: 4.3473e-02024-04-14 12:34:47 [INFO][EVAL] #Images: 420 mIoU: 0.6764 Acc: 0.8370 Kappa: 0.8102 2024-04-14 12:34:47 [INFO][EVAL] Class IoU: [0.     0.6189 0.56   0.7151 0.6693 0.5738 0.7879 0.5127 0.9634 0.6378 0.669  0.8069 0.7086 0.9449 0.6956 0.7226 0.7423 0.8469]2024-04-14 12:34:47 [INFO][EVAL] Class Acc: [0.     0.7452 0.7343 0.7984 0.8166 0.767  0.8257 0.7523 1.     0.7964 0.7517 0.8972 0.8457 0.9782 0.7789 0.7646 0.8452 0.9181]2024-04-14 12:34:48 [INFO][EVAL] The model with the best validation mIoU (0.6764) was saved at iter 800.2024-04-14 12:34:54 [INFO][TRAIN] epoch: 16, iter: 810/1000, loss: 0.5991, lr: 0.002254, batch_cost: 0.5941, reader_cost: 0.00210, ips: 53.8640 samples/sec | ETA 00:01:522024-04-14 12:34:59 [INFO][TRAIN] epoch: 16, iter: 820/1000, loss: 0.5848, lr: 0.002147, batch_cost: 0.5925, reader_cost: 0.00075, ips: 54.0113 samples/sec | ETA 00:01:462024-04-14 12:35:05 [INFO][TRAIN] epoch: 16, iter: 830/1000, loss: 0.5802, lr: 0.002040, batch_cost: 0.5780, reader_cost: 0.00066, ips: 55.3610 samples/sec | ETA 00:01:382024-04-14 12:35:11 [INFO][TRAIN] epoch: 17, iter: 840/1000, loss: 0.6143, lr: 0.001933, batch_cost: 0.6128, reader_cost: 0.01615, ips: 52.2204 samples/sec | ETA 00:01:382024-04-14 12:35:17 [INFO][TRAIN] epoch: 17, iter: 850/1000, loss: 0.6197, lr: 0.001824, batch_cost: 0.6147, reader_cost: 0.00096, ips: 52.0584 samples/sec | ETA 00:01:322024-04-14 12:35:24 [INFO][TRAIN] epoch: 17, iter: 860/1000, loss: 0.5561, lr: 0.001715, batch_cost: 0.6057, reader_cost: 0.00072, ips: 52.8288 samples/sec | ETA 00:01:242024-04-14 12:35:30 [INFO][TRAIN] epoch: 17, iter: 870/1000, loss: 0.5752, lr: 0.001605, batch_cost: 0.5980, reader_cost: 0.00125, ips: 53.5096 samples/sec | ETA 00:01:172024-04-14 12:35:35 [INFO][TRAIN] epoch: 17, iter: 880/1000, loss: 0.5779, lr: 0.001495, batch_cost: 0.5963, reader_cost: 0.00278, ips: 53.6679 samples/sec | ETA 00:01:112024-04-14 12:35:41 [INFO][TRAIN] epoch: 18, iter: 890/1000, loss: 0.5226, lr: 0.001383, batch_cost: 0.5988, reader_cost: 0.01577, ips: 53.4440 samples/sec | ETA 00:01:052024-04-14 12:35:47 [INFO][TRAIN] epoch: 18, iter: 900/1000, loss: 0.5943, lr: 0.001270, batch_cost: 0.5943, reader_cost: 0.00091, ips: 53.8452 samples/sec | ETA 00:00:592024-04-14 12:35:47 [INFO]Start evaluating (total_samples: 420, total_iters: 420)...420/420 [==============================] - 60s 143ms/step - batch_cost: 0.1424 - reader cost: 4.8283e-2024-04-14 12:36:47 [INFO][EVAL] #Images: 420 mIoU: 0.6823 Acc: 0.8382 Kappa: 0.8114 2024-04-14 12:36:47 [INFO][EVAL] Class IoU: [0.     0.6235 0.5526 0.7267 0.6715 0.5952 0.8155 0.516  0.964  0.6368 0.6684 0.8126 0.7114 0.9239 0.699  0.7702 0.7441 0.8504]2024-04-14 12:36:47 [INFO][EVAL] Class Acc: [0.     0.7182 0.683  0.8378 0.8101 0.7393 0.8766 0.763  0.9997 0.8103 0.7642 0.8939 0.8346 0.9864 0.7791 0.8363 0.8568 0.9297]2024-04-14 12:36:48 [INFO][EVAL] The model with the best validation mIoU (0.6823) was saved at iter 900.2024-04-14 12:36:54 [INFO][TRAIN] epoch: 18, iter: 910/1000, loss: 0.5703, lr: 0.001156, batch_cost: 0.6115, reader_cost: 0.00312, ips: 52.3318 samples/sec | ETA 00:00:552024-04-14 12:37:00 [INFO][TRAIN] epoch: 18, iter: 920/1000, loss: 0.6093, lr: 0.001041, batch_cost: 0.6014, reader_cost: 0.00108, ips: 53.2099 samples/sec | ETA 00:00:482024-04-14 12:37:06 [INFO][TRAIN] epoch: 18, iter: 930/1000, loss: 0.5604, lr: 0.000925, batch_cost: 0.5959, reader_cost: 0.00160, ips: 53.7019 samples/sec | ETA 00:00:412024-04-14 12:37:12 [INFO][TRAIN] epoch: 19, iter: 940/1000, loss: 0.5809, lr: 0.000807, batch_cost: 0.5947, reader_cost: 0.01608, ips: 53.8086 samples/sec | ETA 00:00:352024-04-14 12:37:18 [INFO][TRAIN] epoch: 19, iter: 950/1000, loss: 0.5609, lr: 0.000687, batch_cost: 0.5905, reader_cost: 0.00034, ips: 54.1959 samples/sec | ETA 00:00:292024-04-14 12:37:24 [INFO][TRAIN] epoch: 19, iter: 960/1000, loss: 0.6061, lr: 0.000564, batch_cost: 0.6175, reader_cost: 0.00174, ips: 51.8181 samples/sec | ETA 00:00:242024-04-14 12:37:30 [INFO][TRAIN] epoch: 19, iter: 970/1000, loss: 0.5418, lr: 0.000439, batch_cost: 0.6037, reader_cost: 0.00178, ips: 53.0053 samples/sec | ETA 00:00:182024-04-14 12:37:36 [INFO][TRAIN] epoch: 19, iter: 980/1000, loss: 0.5613, lr: 0.000309, batch_cost: 0.5929, reader_cost: 0.00152, ips: 53.9685 samples/sec | ETA 00:00:112024-04-14 12:37:42 [INFO][TRAIN] epoch: 20, iter: 990/1000, loss: 0.5241, lr: 0.000173, batch_cost: 0.5946, reader_cost: 0.01715, ips: 53.8205 samples/sec | ETA 00:00:052024-04-14 12:37:48 [INFO][TRAIN] epoch: 20, iter: 1000/1000, loss: 0.5681, lr: 0.000020, batch_cost: 0.5928, reader_cost: 0.00015, ips: 53.9844 samples/sec | ETA 00:00:002024-04-14 12:37:48 [INFO]Start evaluating (total_samples: 420, total_iters: 420)...420/420 [==============================] - 60s 144ms/step - batch_cost: 0.1434 - reader cost: 5.1340e-2024-04-14 12:38:48 [INFO][EVAL] #Images: 420 mIoU: 0.6804 Acc: 0.8398 Kappa: 0.8132 2024-04-14 12:38:48 [INFO][EVAL] Class IoU: [0.     0.6279 0.5664 0.7303 0.6736 0.5809 0.8024 0.5217 0.963  0.6403 0.6745 0.8123 0.6961 0.921  0.699  0.7392 0.7469 0.8508]2024-04-14 12:38:48 [INFO][EVAL] Class Acc: [0.     0.7598 0.7189 0.842  0.8211 0.775  0.8507 0.7527 1.     0.782 0.7552 0.8984 0.8332 0.9858 0.7765 0.804  0.8528 0.936 ]2024-04-14 12:38:49 [INFO][EVAL] The model with the best validation mIoU (0.6823) was saved at iter 900.'s flops has been countedCustomize Function has been applied to Cannot find suitable count function for . Treat it as zero FLOPs.Cannot find suitable count function for . Treat it as zero FLOPs./opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/tensor/creation.py:125: DeprecationWarning: `np.object` is a deprecated alias for the builtin `object`. To silence this warning, use `object` by itself. Doing this will not modify any behavior and is safe. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations  if data.dtype == np.object:Total Flops: 1757012736     Total Params: 12122446
登录后复制        

模型测试

参考paddleSeg

In [9]
# 模型测试, aug_eval可以开启增强测试模式# !python val.py \#        --config configs/unet/unet_dlrsd.yml \#        --model_path output/best_model/model.pdparams \#        --aug_eval \#        --scales 0.75 1.0 1.25 \#        --flip_horizontal# 使用ocrnet进行测试!python val.py \       --config ocrnet_dlrsd.yml \       --model_path output/best_model/model.pdparams \       --aug_eval \       --scales 0.75 1.0 1.25 \       --flip_horizontal
登录后复制        
2024-04-14 12:38:53 [INFO]---------------Config Information---------------batch_size: 2iters: 160000loss:  coef:  - 1  - 0.4  types:  - type: CrossEntropyLoss  - type: CrossEntropyLosslr_scheduler:  end_lr: 0  learning_rate: 0.01  power: 0.9  type: PolynomialDecaymodel:  backbone:    pretrained: https://bj.bcebos.com/paddleseg/dygraph/hrnet_w18_ssld.tar.gz    type: HRNet_W18  backbone_indices:  - 0  num_classes: 18  type: OCRNetoptimizer:  momentum: 0.9  type: sgd  weight_decay: 4.0e-05train_dataset:  dataset_root: dataset/dlrsd  mode: train  num_classes: 18  train_path: dataset/dlrsd/train.txt  transforms:  - max_scale_factor: 2.0    min_scale_factor: 0.5    scale_step_size: 0.25    type: ResizeStepScaling  - crop_size:    - 256    - 256    type: RandomPaddingCrop  - type: RandomHorizontalFlip  - type: Normalize  type: Datasetval_dataset:  dataset_root: dataset/dlrsd  mode: val  num_classes: 18  transforms:  - type: Normalize  - target_size:    - 256    - 256    type: Resize  type: Dataset  val_path: dataset/dlrsd/val.txt------------------------------------------------W0414 12:38:53.728370  4958 device_context.cc:404] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 11.0, Runtime API Version: 10.1W0414 12:38:53.728415  4958 device_context.cc:422] device: 0, cuDNN Version: 7.6.2024-04-14 12:38:57 [INFO]Loading pretrained model from https://bj.bcebos.com/paddleseg/dygraph/hrnet_w18_ssld.tar.gz2024-04-14 12:38:58 [INFO]There are 1525/1525 variables loaded into HRNet.2024-04-14 12:38:58 [INFO]Loading pretrained model from output/best_model/model.pdparams2024-04-14 12:38:58 [INFO]There are 1583/1583 variables loaded into OCRNet.2024-04-14 12:38:58 [INFO]Loaded trained params of model successfully2024-04-14 12:38:58 [INFO]Start evaluating (total_samples: 420, total_iters: 420).../opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/math_op_patch.py:239: UserWarning: The dtype of left and right variables are not the same, left dtype is paddle.int32, but right dtype is paddle.bool, the right dtype will convert to paddle.int32  format(lhs_dtype, rhs_dtype, lhs_dtype))/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/math_op_patch.py:239: UserWarning: The dtype of left and right variables are not the same, left dtype is paddle.int64, but right dtype is paddle.bool, the right dtype will convert to paddle.int64  format(lhs_dtype, rhs_dtype, lhs_dtype))420/420 [==============================] - 335s 797ms/step - batch_cost: 0.7971 - reader cost: 8.0393e-2024-04-14 12:44:33 [INFO][EVAL] #Images: 420 mIoU: 0.6839 Acc: 0.8405 Kappa: 0.8143 2024-04-14 12:44:33 [INFO][EVAL] Class IoU: [0.     0.6325 0.563  0.7203 0.6722 0.6052 0.8156 0.5139 0.9655 0.6445 0.6614 0.814  0.7313 0.9119 0.7007 0.7548 0.7473 0.8563]2024-04-14 12:44:33 [INFO][EVAL] Class Acc: [0.     0.7304 0.7056 0.8246 0.7997 0.7365 0.872  0.8375 1.     0.8088 0.7385 0.9016 0.829  0.9841 0.7464 0.8043 0.8618 0.9425]
登录后复制        

模型推理

参考paddleSeg

In [10]
# 模型推理, image_path可以设置为单个文件或者文件夹# !python predict.py \#        --config configs/unet/unet_dlrsd.yml \#        --model_path output/best_model/model.pdparams \#        --image_path dataset/dlrsd/image/agricultural00.tif \#        --save_dir output/result# 使用ocrnet模型推理!python predict.py \       --config ocrnet_dlrsd.yml \       --model_path output/best_model/model.pdparams \       --image_path dataset/dlrsd/image/agricultural00.tif \       --save_dir output/result
登录后复制        
2024-04-14 12:44:36 [INFO]---------------Config Information---------------batch_size: 2iters: 160000loss:  coef:  - 1  - 0.4  types:  - type: CrossEntropyLoss  - type: CrossEntropyLosslr_scheduler:  end_lr: 0  learning_rate: 0.01  power: 0.9  type: PolynomialDecaymodel:  backbone:    pretrained: https://bj.bcebos.com/paddleseg/dygraph/hrnet_w18_ssld.tar.gz    type: HRNet_W18  backbone_indices:  - 0  num_classes: 18  type: OCRNetoptimizer:  momentum: 0.9  type: sgd  weight_decay: 4.0e-05train_dataset:  dataset_root: dataset/dlrsd  mode: train  num_classes: 18  train_path: dataset/dlrsd/train.txt  transforms:  - max_scale_factor: 2.0    min_scale_factor: 0.5    scale_step_size: 0.25    type: ResizeStepScaling  - crop_size:    - 256    - 256    type: RandomPaddingCrop  - type: RandomHorizontalFlip  - type: Normalize  type: Datasetval_dataset:  dataset_root: dataset/dlrsd  mode: val  num_classes: 18  transforms:  - type: Normalize  - target_size:    - 256    - 256    type: Resize  type: Dataset  val_path: dataset/dlrsd/val.txt------------------------------------------------W0414 12:44:36.429344  6170 device_context.cc:404] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 11.0, Runtime API Version: 10.1W0414 12:44:36.429426  6170 device_context.cc:422] device: 0, cuDNN Version: 7.6.2024-04-14 12:44:39 [INFO]Loading pretrained model from https://bj.bcebos.com/paddleseg/dygraph/hrnet_w18_ssld.tar.gz2024-04-14 12:44:40 [INFO]There are 1525/1525 variables loaded into HRNet.2024-04-14 12:44:40 [INFO]Number of predict images = 12024-04-14 12:44:40 [INFO]Loading pretrained model from output/best_model/model.pdparams2024-04-14 12:44:41 [INFO]There are 1583/1583 variables loaded into OCRNet.2024-04-14 12:44:41 [INFO]Start to predict...1/1 [==============================] - 0s 173ms/step
登录后复制        

推理结果展示

基于paddleSeg的自定义遥感数据语义分割——以DLRSD为例 - 游乐网        

基于paddleSeg的自定义遥感数据语义分割——以DLRSD为例 - 游乐网        

基于paddleSeg的自定义遥感数据语义分割——以DLRSD为例 - 游乐网        

热门推荐

更多

热门文章

更多

首页  返回顶部

本站所有软件都由网友上传,如有侵犯您的版权,请发邮件youleyoucom@outlook.com