热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

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

转自AIStudio,原文链接:基于paddleSeg的自定义遥感数据语义分割——以DLRSD为例-飞桨AIStudio基于paddleseg2.1使

转自AI Studio,原文链接:基于paddleSeg的自定义遥感数据语义分割——以DLRSD为例 - 飞桨AI Studio

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

数据格式准备


DLRSD数据集


  • 基于UCMerced_LandUse数据集进行标注
  • 标注了17种类型的遥感地物类型
  • 图像尺寸256 * 256 * 3
  • 图像数21* 100 = 2100
  • gt格式,单通道8bit彩图,推荐使用PIL读取
  • 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.png
images/image2.jpg labels/label2.png
...

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

train_dataset:type: Datasetdataset_root: custom_datasettrain_path: custom_dataset/train.txtnum_classes: 2transforms:- type: ResizeStepScalingmin_scale_factor: 0.5max_scale_factor: 2.0scale_step_size: 0.25- type: RandomPaddingCropcrop_size: [512, 512]- type: RandomHorizontalFlip- type: Normalizemode: 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/PaddleSeg
fatal: 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/simple
Requirement 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,>&#61;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,>&#61;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,>&#61;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>&#61;1.1.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from visualdl>&#61;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>&#61;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>&#61;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>&#61;2.0.0->-r requirements.txt (line 5)) (0.8.53)
Requirement already satisfied: protobuf>&#61;3.11.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from visualdl>&#61;2.0.0->-r requirements.txt (line 5)) (3.14.0)
Requirement already satisfied: Flask-Babel>&#61;1.0.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from visualdl>&#61;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>&#61;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>&#61;2.0.0->-r requirements.txt (line 5)) (2.2.3)
Requirement already satisfied: Pillow>&#61;7.0.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from visualdl>&#61;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>&#61;2.0.0->-r requirements.txt (line 5)) (1.1.5)
Requirement already satisfied: Werkzeug>&#61;0.15 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from flask>&#61;1.1.1->visualdl>&#61;2.0.0->-r requirements.txt (line 5)) (0.16.0)
Requirement already satisfied: itsdangerous>&#61;0.24 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from flask>&#61;1.1.1->visualdl>&#61;2.0.0->-r requirements.txt (line 5)) (1.1.0)
Requirement already satisfied: Jinja2>&#61;2.10.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from flask>&#61;1.1.1->visualdl>&#61;2.0.0->-r requirements.txt (line 5)) (3.0.0)
Requirement already satisfied: click>&#61;5.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from flask>&#61;1.1.1->visualdl>&#61;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>&#61;1.0.0->visualdl>&#61;2.0.0->-r requirements.txt (line 5)) (2022.1)
Requirement already satisfied: Babel>&#61;2.3 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from Flask-Babel>&#61;1.0.0->visualdl>&#61;2.0.0->-r requirements.txt (line 5)) (2.9.1)
Requirement already satisfied: typing-extensions>&#61;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>&#61;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>&#61;3.8.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from bce-python-sdk->visualdl>&#61;2.0.0->-r requirements.txt (line 5)) (3.9.9)
Requirement already satisfied: future>&#61;0.6.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from bce-python-sdk->visualdl>&#61;2.0.0->-r requirements.txt (line 5)) (0.18.0)
Requirement already satisfied: python-dateutil>&#61;2.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from matplotlib->visualdl>&#61;2.0.0->-r requirements.txt (line 5)) (2.8.2)
Requirement already satisfied: pyparsing!&#61;2.0.4,!&#61;2.1.2,!&#61;2.1.6,>&#61;2.0.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from matplotlib->visualdl>&#61;2.0.0->-r requirements.txt (line 5)) (3.0.7)
Requirement already satisfied: cycler>&#61;0.10 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from matplotlib->visualdl>&#61;2.0.0->-r requirements.txt (line 5)) (0.10.0)
Requirement already satisfied: kiwisolver>&#61;1.0.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from matplotlib->visualdl>&#61;2.0.0->-r requirements.txt (line 5)) (1.1.0)
Requirement already satisfied: certifi>&#61;2017.4.17 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from requests->visualdl>&#61;2.0.0->-r requirements.txt (line 5)) (2021.10.8)
Requirement already satisfied: idna<4,>&#61;2.5 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from requests->visualdl>&#61;2.0.0->-r requirements.txt (line 5)) (3.3)
Requirement already satisfied: charset-normalizer~&#61;2.0.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from requests->visualdl>&#61;2.0.0->-r requirements.txt (line 5)) (2.0.12)
Requirement already satisfied: urllib3<1.27,>&#61;1.21.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from requests->visualdl>&#61;2.0.0->-r requirements.txt (line 5)) (1.26.9)
Requirement already satisfied: MarkupSafe>&#61;2.0.0rc2 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from Jinja2>&#61;2.10.1->flask>&#61;1.1.1->visualdl>&#61;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>&#61;1.0.1->matplotlib->visualdl>&#61;2.0.0->-r requirements.txt (line 5)) (56.2.0)

预修改的文件&#xff1a;

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

  • 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 [ ]

# 数据预处理&#xff0c;将文件组织自定义数据集格式
# 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 finish
airplane finish
tenniscourt finish
chaparral finish
freeway finish
parkinglot finish
mobilehomepark finish
buildings finish
sparseresidential finish
baseballdiamond finish
runway finish
denseresidential finish
beach finish
storagetanks finish
river finish
forest finish
overpass finish
golfcourse finish
harbor finish
intersection finish
mediumresidential finish
copy from /home/aistudio/data/gt_color/DLRSD/Images to /home/aistudio/PaddleSeg/dataset/dlrsd/gt:
agricultural finish
airplane finish
tenniscourt finish
chaparral finish
freeway finish
parkinglot finish
mobilehomepark finish
buildings finish
sparseresidential finish
baseballdiamond finish
runway finish
denseresidential finish
beach finish
storagetanks finish
river finish
forest finish
overpass finish
golfcourse finish
harbor finish
intersection finish
mediumresidential finish
total 2100, split: train 1680 - 0.80 rate, val 420 - 0.20 rate, test 0 - 0.00 rate

模型训练

参考paddleSeg

In [8]

# 模型训练, 其他超参数可参考paddleSeg&#xff0c;对unet_dlrds.yml进行修改
# unet_dlrds.yml中的参数会覆盖dlrsd.yml中的参数&#xff0c;修改参数时&#xff0c;可以直接在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进行训练&#xff0c;得到更高精度
!python train.py \--batch_size 32 \--iters 1000 \--config ocrnet_dlrsd.yml \--do_eval \--use_vdl \--save_interval 100 \--save_dir output

2022-04-14 12:18:35 [INFO]
------------Environment Information-------------
platform: Linux-4.13.0-36-generic-x86_64-with-debian-stretch-sid
Python: 3.7.4 (default, Aug 13 2019, 20:35:49) [GCC 7.3.0]
Paddle compiled with cuda: True
NVCC: Cuda compilation tools, release 10.1, V10.1.243
cudnn: 7.6
GPUs used: 1
CUDA_VISIBLE_DEVICES: None
GPU: [&#39;GPU 0: Tesla V100-SXM2-16GB&#39;]
GCC: gcc (Ubuntu 7.5.0-3ubuntu1~16.04) 7.5.0
PaddlePaddle: 2.1.2
OpenCV: 4.1.1
------------------------------------------------
2022-04-14 12:18:35 [INFO]
---------------Config Information---------------
batch_size: 32
iters: 1000
loss:coef:- 1- 0.4types:- ignore_index: 255type: CrossEntropyLoss- ignore_index: 255type: CrossEntropyLoss
lr_scheduler:end_lr: 0learning_rate: 0.01power: 0.9type: PolynomialDecay
model:backbone:pretrained: https://bj.bcebos.com/paddleseg/dygraph/hrnet_w18_ssld.tar.gztype: HRNet_W18backbone_indices:- 0num_classes: 18type: OCRNet
optimizer:momentum: 0.9type: sgdweight_decay: 4.0e-05
train_dataset:dataset_root: dataset/dlrsdmode: trainnum_classes: 18train_path: dataset/dlrsd/train.txttransforms:- max_scale_factor: 2.0min_scale_factor: 0.5scale_step_size: 0.25type: ResizeStepScaling- crop_size:- 256- 256type: RandomPaddingCrop- type: RandomHorizontalFlip- type: Normalizetype: Dataset
val_dataset:dataset_root: dataset/dlrsdmode: valnum_classes: 18transforms:- type: Normalize- target_size:- 256- 256type: Resizetype: Datasetval_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.1
W0414 12:18:35.587553 602 device_context.cc:422] device: 0, cuDNN Version: 7.6.
2022-04-14 12:18:39 [INFO] Loading pretrained model from https://bj.bcebos.com/paddleseg/dygraph/hrnet_w18_ssld.tar.gz
2022-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: &#96;np.bool&#96; is a deprecated alias for the builtin &#96;bool&#96;. To silence this warning, use &#96;bool&#96; by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use &#96;np.bool_&#96; here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecationselif dtype &#61;&#61; np.bool:
2022-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:58
2022-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:07
2022-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:38
2022-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:40
2022-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:28
2022-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:26
2022-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:04
2022-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:01
2022-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:22
2022-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:54
2022-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.int32format(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.int64format(lhs_dtype, rhs_dtype, lhs_dtype))
420/420 [&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;] - 60s 142ms/step - batch_cost: 0.1419 - reader cost: 3.9444e-
2022-04-14 12:20:40 [INFO] [EVAL] #Images: 420 mIoU: 0.3062 Acc: 0.6152 Kappa: 0.5491
2022-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.42010.0166 0.6178 0.2826 0.5871 0.15 0. 0.6299 0.294 ]
2022-04-14 12:20:40 [INFO] [EVAL] Class Acc:
[0. 0. 0.4912 0.9435 0.4735 0.4704 0.3853 0. 1. 0.88080.086 0.6741 0.5215 0.85 0.1504 0. 0.6799 0.3236]
2022-04-14 12:20:41 [INFO] [EVAL] The model with the best validation mIoU (0.3062) was saved at iter 100.
2022-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:47
2022-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:45
2022-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:50
2022-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:35
2022-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:28
2022-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:12
2022-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:13
2022-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:05
2022-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:02
2022-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:24
2022-04-14 12:21:41 [INFO] Start evaluating (total_samples: 420, total_iters: 420)...
420/420 [&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;] - 61s 144ms/step - batch_cost: 0.1440 - reader cost: 4.2161e-0
2022-04-14 12:22:41 [INFO] [EVAL] #Images: 420 mIoU: 0.5294 Acc: 0.7634 Kappa: 0.7237
2022-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.53890.5181 0.7464 0.4466 0.8169 0.552 0.6634 0.69 0.7388]
2022-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.68250.7245 0.8834 0.8107 0.9022 0.5718 0.8478 0.7959 0.9131]
2022-04-14 12:22:42 [INFO] [EVAL] The model with the best validation mIoU (0.5294) was saved at iter 200.
2022-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:51
2022-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:48
2022-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:39
2022-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:36
2022-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:40
2022-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:58
2022-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:31
2022-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:11
2022-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:00
2022-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:03
2022-04-14 12:23:42 [INFO] Start evaluating (total_samples: 420, total_iters: 420)...
420/420 [&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;] - 60s 144ms/step - batch_cost: 0.1435 - reader cost: 4.1186e-0
2022-04-14 12:24:42 [INFO] [EVAL] #Images: 420 mIoU: 0.5801 Acc: 0.7912 Kappa: 0.7568
2022-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.58030.491 0.7786 0.5816 0.9076 0.5717 0.616 0.6964 0.7239]
2022-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.71050.5133 0.8871 0.7654 0.9173 0.6074 0.6626 0.7855 0.9062]
2022-04-14 12:24:43 [INFO] [EVAL] The model with the best validation mIoU (0.5801) was saved at iter 300.
2022-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:08
2022-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:51
2022-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:49
2022-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:35
2022-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:29
2022-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:18
2022-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:15
2022-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:09
2022-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:06
2022-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:58
2022-04-14 12:25:43 [INFO] Start evaluating (total_samples: 420, total_iters: 420)...
420/420 [&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;] - 60s 142ms/step - batch_cost: 0.1421 - reader cost: 3.9464e-0
2022-04-14 12:26:43 [INFO] [EVAL] #Images: 420 mIoU: 0.6354 Acc: 0.8046 Kappa: 0.7733
2022-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.60510.5929 0.7681 0.6005 0.932 0.6718 0.6875 0.7183 0.812 ]
2022-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.77530.7934 0.917 0.7802 0.9715 0.7451 0.7686 0.8394 0.8891]
2022-04-14 12:26:44 [INFO] [EVAL] The model with the best validation mIoU (0.6354) was saved at iter 400.
2022-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:51
2022-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:48
2022-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:45
2022-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:31
2022-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:28
2022-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:25
2022-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:11
2022-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:08
2022-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:07
2022-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:58
2022-04-14 12:27:44 [INFO] Start evaluating (total_samples: 420, total_iters: 420)...
420/420 [&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;] - 60s 143ms/step - batch_cost: 0.1428 - reader cost: 4.3921e-
2022-04-14 12:28:44 [INFO] [EVAL] #Images: 420 mIoU: 0.6433 Acc: 0.8158 Kappa: 0.7854
2022-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.60450.5682 0.7844 0.6218 0.9213 0.6765 0.666 0.7303 0.8215]
2022-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.74340.768 0.898 0.7861 0.9472 0.7861 0.7684 0.8051 0.9003]
2022-04-14 12:28:45 [INFO] [EVAL] The model with the best validation mIoU (0.6433) was saved at iter 500.
2022-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:59
2022-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:32
2022-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:10
2022-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:36
2022-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:29
2022-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:27
2022-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:12
2022-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:11
2022-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:02
2022-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:59
2022-04-14 12:29:45 [INFO] Start evaluating (total_samples: 420, total_iters: 420)...
420/420 [&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;] - 60s 142ms/step - batch_cost: 0.1415 - reader cost: 4.0659e-0
2022-04-14 12:30:44 [INFO] [EVAL] #Images: 420 mIoU: 0.6476 Acc: 0.8181 Kappa: 0.7884
2022-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.61580.6408 0.7854 0.6181 0.9192 0.6675 0.6941 0.7279 0.8105]
2022-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.74410.7843 0.9157 0.8449 0.9835 0.7029 0.7389 0.8188 0.874 ]
2022-04-14 12:30:45 [INFO] [EVAL] The model with the best validation mIoU (0.6476) was saved at iter 600.
2022-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:59
2022-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:43
2022-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:39
2022-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:48
2022-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:29
2022-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:22
2022-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:17
2022-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:09
2022-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:09
2022-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:59
2022-04-14 12:31:46 [INFO] Start evaluating (total_samples: 420, total_iters: 420)...
420/420 [&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;] - 60s 143ms/step - batch_cost: 0.1428 - reader cost: 4.3040e-0
2022-04-14 12:32:46 [INFO] [EVAL] #Images: 420 mIoU: 0.6746 Acc: 0.8354 Kappa: 0.8078
2022-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.6310.6657 0.799 0.7254 0.9374 0.6921 0.7311 0.7419 0.8457]
2022-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.78560.7755 0.8704 0.8246 0.9818 0.7645 0.7729 0.8567 0.9267]
2022-04-14 12:32:46 [INFO] [EVAL] The model with the best validation mIoU (0.6746) was saved at iter 700.
2022-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:53
2022-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:46
2022-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:38
2022-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:35
2022-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:36
2022-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:24
2022-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:17
2022-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:06
2022-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:09
2022-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:01
2022-04-14 12:33:46 [INFO] Start evaluating (total_samples: 420, total_iters: 420)...
420/420 [&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;] - 60s 143ms/step - batch_cost: 0.1431 - reader cost: 4.3473e-0
2022-04-14 12:34:47 [INFO] [EVAL] #Images: 420 mIoU: 0.6764 Acc: 0.8370 Kappa: 0.8102
2022-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.63780.669 0.8069 0.7086 0.9449 0.6956 0.7226 0.7423 0.8469]
2022-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.79640.7517 0.8972 0.8457 0.9782 0.7789 0.7646 0.8452 0.9181]
2022-04-14 12:34:48 [INFO] [EVAL] The model with the best validation mIoU (0.6764) was saved at iter 800.
2022-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:52
2022-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:46
2022-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:38
2022-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:38
2022-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:32
2022-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:24
2022-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:17
2022-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:11
2022-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:05
2022-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:59
2022-04-14 12:35:47 [INFO] Start evaluating (total_samples: 420, total_iters: 420)...
420/420 [&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;] - 60s 143ms/step - batch_cost: 0.1424 - reader cost: 4.8283e-
2022-04-14 12:36:47 [INFO] [EVAL] #Images: 420 mIoU: 0.6823 Acc: 0.8382 Kappa: 0.8114
2022-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.63680.6684 0.8126 0.7114 0.9239 0.699 0.7702 0.7441 0.8504]
2022-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.81030.7642 0.8939 0.8346 0.9864 0.7791 0.8363 0.8568 0.9297]
2022-04-14 12:36:48 [INFO] [EVAL] The model with the best validation mIoU (0.6823) was saved at iter 900.
2022-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:55
2022-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:48
2022-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:41
2022-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:35
2022-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:29
2022-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:24
2022-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:18
2022-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:11
2022-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:05
2022-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:00
2022-04-14 12:37:48 [INFO] Start evaluating (total_samples: 420, total_iters: 420)...
420/420 [&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;] - 60s 144ms/step - batch_cost: 0.1434 - reader cost: 5.1340e-
2022-04-14 12:38:48 [INFO] [EVAL] #Images: 420 mIoU: 0.6804 Acc: 0.8398 Kappa: 0.8132
2022-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.64030.6745 0.8123 0.6961 0.921 0.699 0.7392 0.7469 0.8508]
2022-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.7820.7552 0.8984 0.8332 0.9858 0.7765 0.804 0.8528 0.936 ]
2022-04-14 12:38:49 [INFO] [EVAL] The model with the best validation mIoU (0.6823) was saved at iter 900.
&#39;s flops has been counted
Customize 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: &#96;np.object&#96; is a deprecated alias for the builtin &#96;object&#96;. To silence this warning, use &#96;object&#96; 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#deprecationsif data.dtype &#61;&#61; 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

2022-04-14 12:38:53 [INFO]
---------------Config Information---------------
batch_size: 2
iters: 160000
loss:coef:- 1- 0.4types:- type: CrossEntropyLoss- type: CrossEntropyLoss
lr_scheduler:end_lr: 0learning_rate: 0.01power: 0.9type: PolynomialDecay
model:backbone:pretrained: https://bj.bcebos.com/paddleseg/dygraph/hrnet_w18_ssld.tar.gztype: HRNet_W18backbone_indices:- 0num_classes: 18type: OCRNet
optimizer:momentum: 0.9type: sgdweight_decay: 4.0e-05
train_dataset:dataset_root: dataset/dlrsdmode: trainnum_classes: 18train_path: dataset/dlrsd/train.txttransforms:- max_scale_factor: 2.0min_scale_factor: 0.5scale_step_size: 0.25type: ResizeStepScaling- crop_size:- 256- 256type: RandomPaddingCrop- type: RandomHorizontalFlip- type: Normalizetype: Dataset
val_dataset:dataset_root: dataset/dlrsdmode: valnum_classes: 18transforms:- type: Normalize- target_size:- 256- 256type: Resizetype: Datasetval_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.1
W0414 12:38:53.728415 4958 device_context.cc:422] device: 0, cuDNN Version: 7.6.
2022-04-14 12:38:57 [INFO] Loading pretrained model from https://bj.bcebos.com/paddleseg/dygraph/hrnet_w18_ssld.tar.gz
2022-04-14 12:38:58 [INFO] There are 1525/1525 variables loaded into HRNet.
2022-04-14 12:38:58 [INFO] Loading pretrained model from output/best_model/model.pdparams
2022-04-14 12:38:58 [INFO] There are 1583/1583 variables loaded into OCRNet.
2022-04-14 12:38:58 [INFO] Loaded trained params of model successfully
2022-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.int32format(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.int64format(lhs_dtype, rhs_dtype, lhs_dtype))
420/420 [&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;] - 335s 797ms/step - batch_cost: 0.7971 - reader cost: 8.0393e-
2022-04-14 12:44:33 [INFO] [EVAL] #Images: 420 mIoU: 0.6839 Acc: 0.8405 Kappa: 0.8143
2022-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.64450.6614 0.814 0.7313 0.9119 0.7007 0.7548 0.7473 0.8563]
2022-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.80880.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

2022-04-14 12:44:36 [INFO]
---------------Config Information---------------
batch_size: 2
iters: 160000
loss:coef:- 1- 0.4types:- type: CrossEntropyLoss- type: CrossEntropyLoss
lr_scheduler:end_lr: 0learning_rate: 0.01power: 0.9type: PolynomialDecay
model:backbone:pretrained: https://bj.bcebos.com/paddleseg/dygraph/hrnet_w18_ssld.tar.gztype: HRNet_W18backbone_indices:- 0num_classes: 18type: OCRNet
optimizer:momentum: 0.9type: sgdweight_decay: 4.0e-05
train_dataset:dataset_root: dataset/dlrsdmode: trainnum_classes: 18train_path: dataset/dlrsd/train.txttransforms:- max_scale_factor: 2.0min_scale_factor: 0.5scale_step_size: 0.25type: ResizeStepScaling- crop_size:- 256- 256type: RandomPaddingCrop- type: RandomHorizontalFlip- type: Normalizetype: Dataset
val_dataset:dataset_root: dataset/dlrsdmode: valnum_classes: 18transforms:- type: Normalize- target_size:- 256- 256type: Resizetype: Datasetval_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.1
W0414 12:44:36.429426 6170 device_context.cc:422] device: 0, cuDNN Version: 7.6.
2022-04-14 12:44:39 [INFO] Loading pretrained model from https://bj.bcebos.com/paddleseg/dygraph/hrnet_w18_ssld.tar.gz
2022-04-14 12:44:40 [INFO] There are 1525/1525 variables loaded into HRNet.
2022-04-14 12:44:40 [INFO] Number of predict images &#61; 1
2022-04-14 12:44:40 [INFO] Loading pretrained model from output/best_model/model.pdparams
2022-04-14 12:44:41 [INFO] There are 1583/1583 variables loaded into OCRNet.
2022-04-14 12:44:41 [INFO] Start to predict...
1/1 [&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;] - 0s 173ms/step

推理结果展示


推荐阅读
  • 本文介绍了设计师伊振华受邀参与沈阳市智慧城市运行管理中心项目的整体设计,并以数字赋能和创新驱动高质量发展的理念,建设了集成、智慧、高效的一体化城市综合管理平台,促进了城市的数字化转型。该中心被称为当代城市的智能心脏,为沈阳市的智慧城市建设做出了重要贡献。 ... [详细]
  • sklearn数据集库中的常用数据集类型介绍
    本文介绍了sklearn数据集库中常用的数据集类型,包括玩具数据集和样本生成器。其中详细介绍了波士顿房价数据集,包含了波士顿506处房屋的13种不同特征以及房屋价格,适用于回归任务。 ... [详细]
  • 本文讨论了clone的fork与pthread_create创建线程的不同之处。进程是一个指令执行流及其执行环境,其执行环境是一个系统资源的集合。在调用系统调用fork创建一个进程时,子进程只是完全复制父进程的资源,这样得到的子进程独立于父进程,具有良好的并发性。但是二者之间的通讯需要通过专门的通讯机制,另外通过fork创建子进程系统开销很大。因此,在某些情况下,使用clone或pthread_create创建线程可能更加高效。 ... [详细]
  • 微软头条实习生分享深度学习自学指南
    本文介绍了一位微软头条实习生自学深度学习的经验分享,包括学习资源推荐、重要基础知识的学习要点等。作者强调了学好Python和数学基础的重要性,并提供了一些建议。 ... [详细]
  • 在Docker中,将主机目录挂载到容器中作为volume使用时,常常会遇到文件权限问题。这是因为容器内外的UID不同所导致的。本文介绍了解决这个问题的方法,包括使用gosu和suexec工具以及在Dockerfile中配置volume的权限。通过这些方法,可以避免在使用Docker时出现无写权限的情况。 ... [详细]
  • baresip android编译、运行教程1语音通话
    本文介绍了如何在安卓平台上编译和运行baresip android,包括下载相关的sdk和ndk,修改ndk路径和输出目录,以及创建一个c++的安卓工程并将目录考到cpp下。详细步骤可参考给出的链接和文档。 ... [详细]
  • 解决Cydia数据库错误:could not open file /var/lib/dpkg/status 的方法
    本文介绍了解决iOS系统中Cydia数据库错误的方法。通过使用苹果电脑上的Impactor工具和NewTerm软件,以及ifunbox工具和终端命令,可以解决该问题。具体步骤包括下载所需工具、连接手机到电脑、安装NewTerm、下载ifunbox并注册Dropbox账号、下载并解压lib.zip文件、将lib文件夹拖入Books文件夹中,并将lib文件夹拷贝到/var/目录下。以上方法适用于已经越狱且出现Cydia数据库错误的iPhone手机。 ... [详细]
  • XML介绍与使用的概述及标签规则
    本文介绍了XML的基本概念和用途,包括XML的可扩展性和标签的自定义特性。同时还详细解释了XML标签的规则,包括标签的尖括号和合法标识符的组成,标签必须成对出现的原则以及特殊标签的使用方法。通过本文的阅读,读者可以对XML的基本知识有一个全面的了解。 ... [详细]
  • CF:3D City Model(小思维)问题解析和代码实现
    本文通过解析CF:3D City Model问题,介绍了问题的背景和要求,并给出了相应的代码实现。该问题涉及到在一个矩形的网格上建造城市的情景,每个网格单元可以作为建筑的基础,建筑由多个立方体叠加而成。文章详细讲解了问题的解决思路,并给出了相应的代码实现供读者参考。 ... [详细]
  • 本文介绍了Windows操作系统的版本及其特点,包括Windows 7系统的6个版本:Starter、Home Basic、Home Premium、Professional、Enterprise、Ultimate。Windows操作系统是微软公司研发的一套操作系统,具有人机操作性优异、支持的应用软件较多、对硬件支持良好等优点。Windows 7 Starter是功能最少的版本,缺乏Aero特效功能,没有64位支持,最初设计不能同时运行三个以上应用程序。 ... [详细]
  • 本文介绍了Swing组件的用法,重点讲解了图标接口的定义和创建方法。图标接口用来将图标与各种组件相关联,可以是简单的绘画或使用磁盘上的GIF格式图像。文章详细介绍了图标接口的属性和绘制方法,并给出了一个菱形图标的实现示例。该示例可以配置图标的尺寸、颜色和填充状态。 ... [详细]
  • 本文介绍了使用哈夫曼树实现文件压缩和解压的方法。首先对数据结构课程设计中的代码进行了分析,包括使用时间调用、常量定义和统计文件中各个字符时相关的结构体。然后讨论了哈夫曼树的实现原理和算法。最后介绍了文件压缩和解压的具体步骤,包括字符统计、构建哈夫曼树、生成编码表、编码和解码过程。通过实例演示了文件压缩和解压的效果。本文的内容对于理解哈夫曼树的实现原理和应用具有一定的参考价值。 ... [详细]
  • 本文介绍了使用Python编写购物程序的实现步骤和代码示例。程序启动后,用户需要输入工资,并打印商品列表。用户可以根据商品编号选择购买商品,程序会检测余额是否充足,如果充足则直接扣款,否则提醒用户。用户可以随时退出程序,在退出时打印已购买商品的数量和余额。附带了完整的代码示例。 ... [详细]
  • 本文讲述了CodeForces1016C题目的解法。文章首先介绍了一种错误的理解,然后给出了正确的解法。其中,当位于一个角上时,有两种选择,一种是先一直走一行再返回来走,另一种是走到这一列的另一行上然后再往右走一列。作者给出了两种解法,一种是直接计算,一种是动态规划。最后,取两种解法的最优解作为答案。文章附上了源代码。 ... [详细]
  • 本文介绍了在Android开发中使用软引用和弱引用的应用。如果一个对象只具有软引用,那么只有在内存不够的情况下才会被回收,可以用来实现内存敏感的高速缓存;而如果一个对象只具有弱引用,不管内存是否足够,都会被垃圾回收器回收。软引用和弱引用还可以与引用队列联合使用,当被引用的对象被回收时,会将引用加入到关联的引用队列中。软引用和弱引用的根本区别在于生命周期的长短,弱引用的对象可能随时被回收,而软引用的对象只有在内存不够时才会被回收。 ... [详细]
author-avatar
Ocean哔哔芭比波哔
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有