复现异常检测论文:RD4AD
论文全名:Anomaly Detection via Reverse Distillation from One-Class Embedding
一、前言
本项目为百度论文复现赛《Anomaly Detection via Reverse Distillation from One-Class Embedding》论文复现代码。
依赖环境:
- paddlepaddle-gpu2.3.1
- python3.7
复现精度
RD4AD | Pixel Auroc | Pixel Aupro | Sample Auroc |
---|---|---|---|
论文 | 97.8 | 93.9 | 98.5 |
复现 | 97.9 | 94.4 | 98.9 |
二、模型背景及其介绍
Motivation
论文针支出传统的知识蒸馏的异常检测存在容易阻碍异常表现的多样性的问题,原因是:
- 传统的知识蒸馏teacher和student的网络架构很相似或者几乎相同
- teacher和student的输入流都是一样的
因为teacher和student网络相似,student学的非常好,有了和teacher很接近的能力,导致在推理阶段输入异常样本,student网络也是有很大的可能重建的和teacher很接近,那么最后的Loss也会比较小,这样对异常检测不利。而且传统知识蒸馏中的student网络都要比teacher小,小网络的重建性能是需要得到质疑的,如果重建能力不是那么好,不管正常还是异常都会产生问题。
针对上面提出的问题,作者提出了反转的知识蒸馏方案,将teacher作为encoder,student作为decoder,并且在teacher和student之间加入了一个one-class bottleneck embedding (OCBE) 模块
在OCBE模块中,包含了多尺度特征融合模块MFF和一类特征提取模块OCE,使用多尺度融合大多数理由都差不多:低维度的特征包含了很多纹理、边缘等信息,高维度的特征包含了很多语义结构等信息。然后多尺度融合其实也进行了一个压缩特征的作用,去掉冗余的信息。
三、数据集
MVTec AD是MVtec公司提出的一个用于异常检测的数据集。与之前的异常检测数据集不同,该数据集模仿了工业实际生产场景,并且主要用于unsupervised anomaly detection。数据集为异常区域都提供了像素级标注,是一个全面的、包含多种物体、多种异常的数据集。数据集包含不同领域中的五种纹理以及十种物体,且训练集中只包含正常样本,测试集中包含正常样本与缺陷样本,因此需要使用无监督方法学习正常样本的特征表示,并用其检测缺陷样本。
数据集下载链接:AiStudio数据集
四、复现代码
Encoder
encoder用的是去掉classification head的WideResnet50,直接用paddle.vision的模型实现
from paddle.vision.models.resnet import wide_resnet50_2
import paddle
import paddle.nn as nn
class WideResnet50(nn.Layer):
"""Wide ResNet-50-2 model from
`"Wide Residual Networks" <https://arxiv.org/pdf/1605.07146.pdf>`_.
Use pretrained model from paddle.vision.models.resnet
"""
def __init__(self):
super(WideResnet50, self).__init__()
self.resnet = wide_resnet50_2(pretrained=True)
def forward(self, x):
ret = []
x = self.resnet.conv1(x)
x = self.resnet.bn1(x)
x = self.resnet.relu(x)
x = self.resnet.maxpool(x)
x = self.resnet.layer1(x)
ret.append(x)
x = self.resnet.layer2(x)
ret.append(x)
x = self.resnet.layer3(x)
ret.append(x)
x = self.resnet.layer4(x)
return ret
one-class bottleneck embedding模块
【 we adopt the 4th residule block of ResNet [14] as the one-class embedding block.】
根据论文,其实就是ResNet的第四个残差block
class BN_layer(nn.Layer):
def __init__(self,
block,
layers: int,
groups: int = 1,
width_per_group: int = 64,
norm_layer: Optional[Callable[..., nn.Layer]] = None,
):
super(BN_layer, self).__init__()
if norm_layer is None:
norm_layer = nn.BatchNorm2D
self._norm_layer = norm_layer
self.groups = groups
self.base_width = width_per_group
self.inplanes = 256 * block.expansion
self.dilation = 1
self.bn_layer = self._make_layer(block, 512, layers, stride=2)
self.conv1 = conv3x3(64 * block.expansion, 128 * block.expansion, 2)
self.bn1 = norm_layer(128 * block.expansion)
self.relu = nn.ReLU()
self.conv2 = conv3x3(128 * block.expansion, 256 * block.expansion, 2)
self.bn2 = norm_layer(256 * block.expansion)
self.conv3 = conv3x3(128 * block.expansion, 256 * block.expansion, 2)
self.bn3 = norm_layer(256 * block.expansion)
self.conv4 = conv1x1(1024 * block.expansion, 512 * block.expansion, 1)
self.bn4 = norm_layer(512 * block.expansion)
for m in self.sublayers():
if isinstance(m, nn.Conv2D):
kaiming_normal_init(m.weight)
elif isinstance(m, (nn.BatchNorm2D, nn.GroupNorm)):
ones_init(m.weight)
zero_init(m.bias)
def _make_layer(self, block: Type[Union[BasicBlock, Bottleneck]], planes: int, blocks: int,
stride: int = 1, dilate: bool = False) -> nn.Sequential:
norm_layer = self._norm_layer
downsample = None
previous_dilation = self.dilation
if dilate:
self.dilation *= stride
stride = 1
if stride != 1 or self.inplanes != planes * block.expansion:
downsample = nn.Sequential(
conv1x1(self.inplanes * 3, planes * block.expansion, stride),
norm_layer(planes * block.expansion),
)
layers = []
layers.append(block(self.inplanes * 3, planes, stride, downsample, self.groups,
self.base_width, previous_dilation, norm_layer))
self.inplanes = planes * block.expansion
for _ in range(1, blocks):
layers.append(block(self.inplanes, planes, groups=self.groups,
base_width=self.base_width, dilation=self.dilation,
norm_layer=norm_layer))
return nn.Sequential(*layers)
def _forward_impl(self, x: Tensor) -> Tensor:
# See note [paddleScript super()]
# x = self.cbam(x)
l1 = self.relu(self.bn2(self.conv2(self.relu(self.bn1(self.conv1(x[0]))))))
l2 = self.relu(self.bn3(self.conv3(x[1])))
feature = paddle.concat([l1, l2, x[2]], 1)
output = self.bn_layer(feature)
# x = self.avgpool(feature_d)
# x = paddle.flatten(x, 1)
# x = self.fc(x)
return output
def forward(self, x: Tensor) -> Tensor:
return self._forward_impl(x)
Deocder
也是WideResnet50
import paddle
from paddle import Tensor
import paddle.nn as nn
from typing import Type, Any, Callable, Union, List, Optional
def conv3x3(in_planes: int, out_planes: int, stride: int = 1, groups: int = 1, dilation: int = 1):
"""3x3 convolution with padding"""
return nn.Conv2D(in_planes, out_planes, kernel_size=3, stride=stride,
padding=dilation, groups=groups, bias_attr=False, dilation=dilation)
def conv1x1(in_planes: int, out_planes: int, stride: int = 1):
"""1x1 convolution"""
return nn.Conv2D(in_planes, out_planes, kernel_size=1, stride=stride, bias_attr=False)
def deconv2x2(in_planes: int, out_planes: int, stride: int = 1, groups: int = 1, dilation: int = 1):
"""1x1 convolution"""
return nn.Conv2DTranspose(in_planes, out_planes, kernel_size=2, stride=stride,
groups=groups, bias_attr=False, dilation=dilation)
class BasicBlock(nn.Layer):
expansion: int = 1
def __init__(
self,
inplanes: int,
planes: int,
stride: int = 1,
upsample: Optional[nn.Layer] = None,
groups: int = 1,
base_width: int = 64,
dilation: int = 1,
norm_layer: Optional[Callable[..., nn.Layer]] = None
) -> None:
super(BasicBlock, self).__init__()
if norm_layer is None:
norm_layer = nn.BatchNorm2D
if groups != 1 or base_width != 64:
raise ValueError('BasicBlock only supports groups=1 and base_width=64')
if dilation > 1:
raise NotImplementedError("Dilation > 1 not supported in BasicBlock")
# Both self.conv1 and self.downsample layers downsample the input when stride != 1
if stride == 2:
self.conv1 = deconv2x2(inplanes, planes, stride)
else:
self.conv1 = conv3x3(inplanes, planes, stride)
self.bn1 = norm_layer(planes)
self.relu = nn.ReLU()
self.conv2 = conv3x3(planes, planes)
self.bn2 = norm_layer(planes)
self.upsample = upsample
self.stride = stride
def forward(self, x: Tensor) -> Tensor:
identity = x
out = self.conv1(x)
out = self.bn1(out)
out = self.relu(out)
out = self.conv2(out)
out = self.bn2(out)
if self.upsample is not None:
identity = self.upsample(x)
out += identity
out = self.relu(out)
return out
class Bottleneck(nn.Layer):
expansion: int = 4
def __init__(
self,
inplanes: int,
planes: int,
stride: int = 1,
upsample: Optional[nn.Layer] = None,
groups: int = 1,
base_width: int = 64,
dilation: int = 1,
norm_layer: Optional[Callable[..., nn.Layer]] = None
) -> None:
super(Bottleneck, self).__init__()
if norm_layer is None:
norm_layer = nn.BatchNorm2D
width = int(planes * (base_width / 64.)) * groups
# Both self.conv2 and self.downsample layers downsample the input when stride != 1
self.conv1 = conv1x1(inplanes, width)
self.bn1 = norm_layer(width)
if stride == 2:
self.conv2 = deconv2x2(width, width, stride, groups, dilation)
else:
self.conv2 = conv3x3(width, width, stride, groups, dilation)
self.bn2 = norm_layer(width)
self.conv3 = conv1x1(width, planes * self.expansion)
self.bn3 = norm_layer(planes * self.expansion)
self.relu = nn.ReLU()
self.upsample = upsample
self.stride = stride
def forward(self, x: Tensor) -> Tensor:
identity = x
out = self.conv1(x)
out = self.bn1(out)
out = self.relu(out)
out = self.conv2(out)
out = self.bn2(out)
out = self.relu(out)
out = self.conv3(out)
out = self.bn3(out)
if self.upsample is not None:
identity = self.upsample(x)
out += identity
out = self.relu(out)
return out
class ResNet(nn.Layer):
def __init__(
self,
block: Type[Union[BasicBlock, Bottleneck]],
layers: List[int],
num_classes: int = 1000,
zero_init_residual: bool = False,
groups: int = 1,
width_per_group: int = 64,
replace_stride_with_dilation: Optional[List[bool]] = None,
norm_layer: Optional[Callable[..., nn.Layer]] = None
) -> None:
super(ResNet, self).__init__()
if norm_layer is None:
norm_layer = nn.BatchNorm2D
self._norm_layer = norm_layer
self.inplanes = 512 * block.expansion
self.dilation = 1
if replace_stride_with_dilation is None:
# each element in the tuple indicates if we should replace
# the 2x2 stride with a dilated convolution instead
replace_stride_with_dilation = [False, False, False]
if len(replace_stride_with_dilation) != 3:
raise ValueError("replace_stride_with_dilation should be None "
"or a 3-element tuple, got {}".format(replace_stride_with_dilation))
self.groups = groups
self.base_width = width_per_group
# self.conv1 = nn.Conv2D(3, self.inplanes, kernel_size=7, stride=2, padding=3,
# bias_attr=False)
# self.bn1 = norm_layer(self.inplanes)
# self.relu = nn.ReLU()
# self.maxpool = nn.MaxPool2d(kernel_size=3, stride=2, padding=1)
self.layer1 = self._make_layer(block, 256, layers[0], stride=2)
self.layer2 = self._make_layer(block, 128, layers[1], stride=2,
dilate=replace_stride_with_dilation[0])
self.layer3 = self._make_layer(block, 64, layers[2], stride=2,
dilate=replace_stride_with_dilation[1])
# self.layer4 = self._make_layer(block, 512, layers[3], stride=2,
# dilate=replace_stride_with_dilation[2])
# self.avgpool = nn.AdaptiveAvgPool2d((1, 1))
# self.fc = nn.Linear(512 * block.expansion, num_classes)
for m in self.sublayers():
if isinstance(m, nn.Conv2D):
kaiming_normal_init(m.weight)
elif isinstance(m, (nn.BatchNorm2D, nn.GroupNorm)):
ones_init(m.weight)
zero_init(m.bias)
# Zero-initialize the last BN in each residual branch,
# so that the residual branch starts with zeros, and each residual block behaves like an identity.
# This improves the model by 0.2~0.3% according to https://arxiv.org/abs/1706.02677
if zero_init_residual:
for m in self.sublayers():
if isinstance(m, Bottleneck):
zero_init(m.bn3.weight) # type: ignore[arg-type]
elif isinstance(m, BasicBlock):
zero_init(m.bn2.weight) # type: ignore[arg-type]
def _make_layer(self, block: Type[Union[BasicBlock, Bottleneck]], planes: int, blocks: int,
stride: int = 1, dilate: bool = False) -> nn.Sequential:
norm_layer = self._norm_layer
upsample = None
previous_dilation = self.dilation
if dilate:
self.dilation *= stride
stride = 1
if stride != 1 or self.inplanes != planes * block.expansion:
upsample = nn.Sequential(
deconv2x2(self.inplanes, planes * block.expansion, stride),
norm_layer(planes * block.expansion),
)
layers = []
layers.append(block(self.inplanes, planes, stride, upsample, self.groups,
self.base_width, previous_dilation, norm_layer))
self.inplanes = planes * block.expansion
for _ in range(1, blocks):
layers.append(block(self.inplanes, planes, groups=self.groups,
base_width=self.base_width, dilation=self.dilation,
norm_layer=norm_layer))
return nn.Sequential(*layers)
def _forward_impl(self, x: Tensor) -> Tensor:
feature_a = self.layer1(x) # 512*8*8->256*16*16
feature_b = self.layer2(feature_a) # 256*16*16->128*32*32
feature_c = self.layer3(feature_b) # 128*32*32->64*64*64
# feature_d = self.layer4(feature_c) # 64*64*64->128*32*32
# x = self.avgpool(feature_d)
# x = paddle.flatten(x, 1)
# x = self.fc(x)
return [feature_c, feature_b, feature_a]
def forward(self, x: Tensor) -> Tensor:
return self._forward_impl(x)
def kaiming_normal_init(weight):
new_weight = paddle.create_parameter(weight.shape, weight.dtype,
default_initializer=nn.initializer.KaimingNormal())
weight.set_value(new_weight)
def ones_init(weight):
weight.set_value(paddle.ones_like(weight))
def zero_init(weight):
weight.set_value(paddle.zeros_like(weight))
def _resnet(
arch: str,
block: Type[Union[BasicBlock, Bottleneck]],
layers: List[int],
pretrained: bool,
progress: bool,
**kwargs: Any
):
model = ResNet(block, layers, **kwargs)
return model
def de_wide_resnet50_2(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> ResNet:
r"""Wide ResNet-50-2 model from
`"Wide Residual Networks" <https://arxiv.org/pdf/1605.07146.pdf>`_.
The model is the same as ResNet except for the bottleneck number of channels
which is twice larger in every block. The number of channels in outer 1x1
convolutions is the same, e.g. last block in ResNet-50 has 2048-512-2048
channels, and in Wide ResNet-50-2 has 2048-1024-2048.
Args:
pretrained (bool): If True, returns a model pre-trained on ImageNet
progress (bool): If True, displays a progress bar of the download to stderr
"""
kwargs['width_per_group'] = 64 * 2
return _resnet('wide_resnet50_2', Bottleneck, [3, 4, 6, 3],
pretrained, progress, **kwargs)
模型组网
encoder = WideResnet50()
bn = BN_layer(AttnBottleneck, 3) # OCBE模块
encoder.eval() # 预训练的WideResnet50,训练时不需要梯度更新
decoder = de_wide_resnet50_2(pretrained=False)
# 前向过程
inputs = encoder(img)
outputs = decoder(bn(inputs))
loss = loss_fucntion(inputs, outputs)
五、运行
1.解压预训练数据
!unzip data/data116256/mvtec_anomaly_detection.zip -d RD4AD-paddle/mvtec/
2、训练
# 安装依赖
!pip install https://paddleocr.bj.bcebos.com/libs/auto_log-1.2.0-py3-none-any.whl
!pip install -r requirements.txt
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting auto-log==1.2.0
Downloading https://paddleocr.bj.bcebos.com/libs/auto_log-1.2.0-py3-none-any.whl (10 kB)
Collecting distro
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/e1/54/d08d1ad53788515392bec14d2d6e8c410bffdc127780a9a4aa8e6854d502/distro-1.7.0-py3-none-any.whl (20 kB)
Collecting GPUtil
Downloading https://pypi.tuna.tsinghua.edu.cn/packages/ed/0e/5c61eedde9f6c87713e89d794f01e378cfd9565847d4576fa627d758c554/GPUtil-1.4.0.tar.gz (5.5 kB)
Preparing metadata (setup.py) ... [?25ldone
[?25hRequirement already satisfied: pynvml in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from auto-log==1.2.0) (8.0.4)
Requirement already satisfied: psutil in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from auto-log==1.2.0) (5.7.2)
Requirement already satisfied: wheel in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from auto-log==1.2.0) (0.36.2)
Building wheels for collected packages: GPUtil
Building wheel for GPUtil (setup.py) ... [?25ldone
[?25h Created wheel for GPUtil: filename=GPUtil-1.4.0-py3-none-any.whl size=7410 sha256=2a7253243f393c6ceb7c374cc3428c4950e1258272277154a29676fa0a098eb0
Stored in directory: /home/aistudio/.cache/pip/wheels/8c/49/cb/e4c32bdc101f068f9f0201d1c99f4141a1faeb73b639029b7c
Successfully built GPUtil
Installing collected packages: GPUtil, distro, auto-log
Successfully installed GPUtil-1.4.0 auto-log-1.2.0 distro-1.7.0
[1m[[0m[34;49mnotice[0m[1;39;49m][0m[39;49m A new release of pip available: [0m[31;49m22.1.2[0m[39;49m -> [0m[32;49m22.2.2[0m
[1m[[0m[34;49mnotice[0m[1;39;49m][0m[39;49m To update, run: [0m[32;49mpip install --upgrade pip[0m
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: scipy==1.7.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from -r requirements.txt (line 1)) (1.7.1)
Requirement already satisfied: numpy==1.20.3 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from -r requirements.txt (line 2)) (1.20.3)
Requirement already satisfied: scikit-image in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from -r requirements.txt (line 3)) (0.19.3)
Requirement already satisfied: imageio>=2.4.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from scikit-image->-r requirements.txt (line 3)) (2.6.1)
Requirement already satisfied: networkx>=2.2 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from scikit-image->-r requirements.txt (line 3)) (2.4)
Requirement already satisfied: tifffile>=2019.7.26 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from scikit-image->-r requirements.txt (line 3)) (2021.11.2)
Requirement already satisfied: packaging>=20.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from scikit-image->-r requirements.txt (line 3)) (21.3)
Requirement already satisfied: PyWavelets>=1.1.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from scikit-image->-r requirements.txt (line 3)) (1.3.0)
Requirement already satisfied: pillow!=7.1.0,!=7.1.1,!=8.3.0,>=6.1.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from scikit-image->-r requirements.txt (line 3)) (8.2.0)
Requirement already satisfied: decorator>=4.3.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from networkx>=2.2->scikit-image->-r requirements.txt (line 3)) (4.4.2)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from packaging>=20.0->scikit-image->-r requirements.txt (line 3)) (3.0.9)
[1m[[0m[34;49mnotice[0m[1;39;49m][0m[39;49m A new release of pip available: [0m[31;49m22.1.2[0m[39;49m -> [0m[32;49m22.2.2[0m
[1m[[0m[34;49mnotice[0m[1;39;49m][0m[39;49m To update, run: [0m[32;49mpip install --upgrade pip[0m
# 全量数据训练
%cd RD4AD-paddle
!python3 main.py
# 少量数据训练
%cd RD4AD-paddle
!python3 main.py --data_dir sample_data
/home/aistudio/RD4AD-paddle
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Requirement already satisfied: scipy==1.7.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from -r requirements.txt (line 1)) (1.7.1)
Requirement already satisfied: numpy==1.20.3 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from -r requirements.txt (line 2)) (1.20.3)
Requirement already satisfied: scikit-image in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from -r requirements.txt (line 3)) (0.19.3)
Requirement already satisfied: imageio>=2.4.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from scikit-image->-r requirements.txt (line 3)) (2.6.1)
Requirement already satisfied: networkx>=2.2 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from scikit-image->-r requirements.txt (line 3)) (2.4)
Requirement already satisfied: pillow!=7.1.0,!=7.1.1,!=8.3.0,>=6.1.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from scikit-image->-r requirements.txt (line 3)) (8.2.0)
Requirement already satisfied: PyWavelets>=1.1.1 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from scikit-image->-r requirements.txt (line 3)) (1.3.0)
Requirement already satisfied: packaging>=20.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from scikit-image->-r requirements.txt (line 3)) (21.3)
Requirement already satisfied: tifffile>=2019.7.26 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from scikit-image->-r requirements.txt (line 3)) (2021.11.2)
Requirement already satisfied: decorator>=4.3.0 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from networkx>=2.2->scikit-image->-r requirements.txt (line 3)) (4.4.2)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages (from packaging>=20.0->scikit-image->-r requirements.txt (line 3)) (3.0.9)
[1m[[0m[34;49mnotice[0m[1;39;49m][0m[39;49m A new release of pip available: [0m[31;49m22.1.2[0m[39;49m -> [0m[32;49m22.2.2[0m
[1m[[0m[34;49mnotice[0m[1;39;49m][0m[39;49m To update, run: [0m[32;49mpip install --upgrade pip[0m
W0818 16:41:58.862470 5403 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 11.2, Runtime API Version: 10.1
W0818 16:41:58.866904 5403 gpu_resources.cc:91] device: 0, cuDNN Version: 7.6.
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/nn/layer/norm.py:654: UserWarning: When training, we now always track global mean and variance.
"When training, we now always track global mean and variance.")
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
Class bottle, Pixel Auroc:0.517, Sample Auroc1.000, Pixel Aupro0.046
Saving model to checkpoints/wres50_bottle.pdparams
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/nn/layer/norm.py:654: UserWarning: When training, we now always track global mean and variance.
"When training, we now always track global mean and variance.")
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
Class bottle, Pixel Auroc:0.932, Sample Auroc1.000, Pixel Aupro0.711
Saving model to checkpoints/wres50_bottle.pdparams
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/nn/layer/norm.py:654: UserWarning: When training, we now always track global mean and variance.
"When training, we now always track global mean and variance.")
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
Class bottle, Pixel Auroc:0.910, Sample Auroc1.000, Pixel Aupro0.689
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/nn/layer/norm.py:654: UserWarning: When training, we now always track global mean and variance.
"When training, we now always track global mean and variance.")
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
Class bottle, Pixel Auroc:0.914, Sample Auroc1.000, Pixel Aupro0.67
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/nn/layer/norm.py:654: UserWarning: When training, we now always track global mean and variance.
"When training, we now always track global mean and variance.")
global step 50 / 100, loss: 0.271146, avg_reader_cost: 0.62602 sec, avg_batch_cost: 0.71306 sec, avg_samples: 5.00000, ips: 7.01201 img/sec
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
Class bottle, Pixel Auroc:0.916, Sample Auroc1.000, Pixel Aupro0.673
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/nn/layer/norm.py:654: UserWarning: When training, we now always track global mean and variance.
"When training, we now always track global mean and variance.")
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
Class bottle, Pixel Auroc:0.918, Sample Auroc1.000, Pixel Aupro0.686
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/nn/layer/norm.py:654: UserWarning: When training, we now always track global mean and variance.
"When training, we now always track global mean and variance.")
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
Class bottle, Pixel Auroc:0.911, Sample Auroc1.000, Pixel Aupro0.664
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/nn/layer/norm.py:654: UserWarning: When training, we now always track global mean and variance.
"When training, we now always track global mean and variance.")
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
Class bottle, Pixel Auroc:0.918, Sample Auroc1.000, Pixel Aupro0.675
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/nn/layer/norm.py:654: UserWarning: When training, we now always track global mean and variance.
"When training, we now always track global mean and variance.")
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
Class bottle, Pixel Auroc:0.920, Sample Auroc1.000, Pixel Aupro0.671
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/nn/layer/norm.py:654: UserWarning: When training, we now always track global mean and variance.
"When training, we now always track global mean and variance.")
global step 100 / 100, loss: 0.146645, avg_reader_cost: 0.66029 sec, avg_batch_cost: 0.72417 sec, avg_samples: 5.00000, ips: 6.90446 img/sec
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
Class bottle, Pixel Auroc:0.918, Sample Auroc1.000, Pixel Aupro0.665
3、 评估
# cls 指定评估类别
%cd RD4AD-paddle
!python main.py --mode eval --cls bottle
[Errno 2] No such file or directory: 'RD4AD-paddle'
/home/aistudio/RD4AD-paddle
W0818 17:01:15.527966 9699 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 11.2, Runtime API Version: 10.1
W0818 17:01:15.532301 9699 gpu_resources.cc:91] device: 0, cuDNN Version: 7.6.
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
/home/aistudio/RD4AD-paddle/test.py:136: 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
binary_amaps = np.zeros_like(amaps, dtype=np.bool)
Class bottle, Pixel Auroc:0.973, Sample Auroc0.968, Pixel Aupro0.92
4、预测
# 模型预测
%cd RD4AD-paddle
!python main.py --mode infer --data_dir sample_data --cls bottle
/home/aistudio/RD4AD-paddle
W0818 16:54:29.753183 8696 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 11.2, Runtime API Version: 10.1
W0818 16:54:29.757499 8696 gpu_resources.cc:91] device: 0, cuDNN Version: 7.6.
Outputs saved in checkpoints
# 导出inference模型并预测
%cd RD4AD-paddle
!python export_model.py
-cls bottle
/home/aistudio/RD4AD-paddle
W0818 16:54:29.753183 8696 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 11.2, Runtime API Version: 10.1
W0818 16:54:29.757499 8696 gpu_resources.cc:91] device: 0, cuDNN Version: 7.6.
Outputs saved in checkpoints
# 导出inference模型并预测
%cd RD4AD-paddle
!python export_model.py
!python infer.py --data_dir sample_data --cls bottle
/home/aistudio/RD4AD-paddle
W0818 16:56:54.136173 9132 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 11.2, Runtime API Version: 10.1
W0818 16:56:54.140415 9132 gpu_resources.cc:91] device: 0, cuDNN Version: 7.6.
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:341: UserWarning: /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/vision/models/resnet.py:167
The behavior of expression A + B has been unified with elementwise_add(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_add(X, Y, axis=0) instead of A + B. This transitional warning will be dropped in the future.
op_type, op_type, EXPRESSION_MAP[method_name]))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:341: UserWarning: /tmp/tmp50ft3m48.py:25
The behavior of expression A + B has been unified with elementwise_add(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_add(X, Y, axis=0) instead of A + B. This transitional warning will be dropped in the future.
op_type, op_type, EXPRESSION_MAP[method_name]))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:341: UserWarning: /tmp/tmply6ejvsj.py:25
The behavior of expression A + B has been unified with elementwise_add(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_add(X, Y, axis=0) instead of A + B. This transitional warning will be dropped in the future.
op_type, op_type, EXPRESSION_MAP[method_name]))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:341: UserWarning: /tmp/tmptejscxgg.py:25
The behavior of expression A + B has been unified with elementwise_add(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_add(X, Y, axis=0) instead of A + B. This transitional warning will be dropped in the future.
op_type, op_type, EXPRESSION_MAP[method_name]))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:341: UserWarning: /tmp/tmp3cufukyl.py:25
The behavior of expression A + B has been unified with elementwise_add(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_add(X, Y, axis=0) instead of A + B. This transitional warning will be dropped in the future.
op_type, op_type, EXPRESSION_MAP[method_name]))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:341: UserWarning: /tmp/tmpcqc7cryw.py:25
The behavior of expression A + B has been unified with elementwise_add(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_add(X, Y, axis=0) instead of A + B. This transitional warning will be dropped in the future.
op_type, op_type, EXPRESSION_MAP[method_name]))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:341: UserWarning: /tmp/tmpurnnabqe.py:25
The behavior of expression A + B has been unified with elementwise_add(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_add(X, Y, axis=0) instead of A + B. This transitional warning will be dropped in the future.
op_type, op_type, EXPRESSION_MAP[method_name]))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:341: UserWarning: /tmp/tmpyemeaxmc.py:25
The behavior of expression A + B has been unified with elementwise_add(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_add(X, Y, axis=0) instead of A + B. This transitional warning will be dropped in the future.
op_type, op_type, EXPRESSION_MAP[method_name]))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:341: UserWarning: /tmp/tmpohse2ynw.py:25
The behavior of expression A + B has been unified with elementwise_add(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_add(X, Y, axis=0) instead of A + B. This transitional warning will be dropped in the future.
op_type, op_type, EXPRESSION_MAP[method_name]))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:341: UserWarning: /tmp/tmpy1l3ts0e.py:25
The behavior of expression A + B has been unified with elementwise_add(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_add(X, Y, axis=0) instead of A + B. This transitional warning will be dropped in the future.
op_type, op_type, EXPRESSION_MAP[method_name]))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:341: UserWarning: /tmp/tmpsl8rwjzd.py:25
The behavior of expression A + B has been unified with elementwise_add(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_add(X, Y, axis=0) instead of A + B. This transitional warning will be dropped in the future.
op_type, op_type, EXPRESSION_MAP[method_name]))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:341: UserWarning: /tmp/tmp716svmkt.py:25
The behavior of expression A + B has been unified with elementwise_add(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_add(X, Y, axis=0) instead of A + B. This transitional warning will be dropped in the future.
op_type, op_type, EXPRESSION_MAP[method_name]))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:341: UserWarning: /tmp/tmp8qsy60_q.py:25
The behavior of expression A + B has been unified with elementwise_add(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_add(X, Y, axis=0) instead of A + B. This transitional warning will be dropped in the future.
op_type, op_type, EXPRESSION_MAP[method_name]))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:341: UserWarning: /tmp/tmps31kkfa9.py:25
The behavior of expression A + B has been unified with elementwise_add(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_add(X, Y, axis=0) instead of A + B. This transitional warning will be dropped in the future.
op_type, op_type, EXPRESSION_MAP[method_name]))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:341: UserWarning: /tmp/tmpkqnmdidj.py:25
The behavior of expression A + B has been unified with elementwise_add(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_add(X, Y, axis=0) instead of A + B. This transitional warning will be dropped in the future.
op_type, op_type, EXPRESSION_MAP[method_name]))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:341: UserWarning: /tmp/tmp_591e723.py:25
The behavior of expression A + B has been unified with elementwise_add(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_add(X, Y, axis=0) instead of A + B. This transitional warning will be dropped in the future.
op_type, op_type, EXPRESSION_MAP[method_name]))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:341: UserWarning: /tmp/tmpbz96xfmr.py:25
The behavior of expression A + B has been unified with elementwise_add(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_add(X, Y, axis=0) instead of A + B. This transitional warning will be dropped in the future.
op_type, op_type, EXPRESSION_MAP[method_name]))
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/auto_log/env.py:53: DeprecationWarning: distro.linux_distribution() is deprecated. It should only be used as a compatibility shim with Python's platform.linux_distribution(). Please use distro.id(), distro.version() and distro.name() instead.
plat = distro.linux_distribution()[0]
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/auto_log/env.py:54: DeprecationWarning: distro.linux_distribution() is deprecated. It should only be used as a compatibility shim with Python's platform.linux_distribution(). Please use distro.id(), distro.version() and distro.name() instead.
ver = distro.linux_distribution()[1]
INFO 2022-08-18 16:57:15,658 autolog.py:215]
[2022/08/18 16:57:15] root INFO:
INFO 2022-08-18 16:57:15,658 autolog.py:217] ---------------------- Env info ----------------------
[2022/08/18 16:57:15] root INFO: ---------------------- Env info ----------------------
INFO 2022-08-18 16:57:15,658 autolog.py:219] OS_version: Ubuntu 16.04
[2022/08/18 16:57:15] root INFO: OS_version: Ubuntu 16.04
INFO 2022-08-18 16:57:15,658 autolog.py:220] CUDA_version: 10.1.243
[2022/08/18 16:57:15] root INFO: CUDA_version: 10.1.243
INFO 2022-08-18 16:57:15,658 autolog.py:222] CUDNN_version: 7.3.1
[2022/08/18 16:57:15] root INFO: CUDNN_version: 7.3.1
INFO 2022-08-18 16:57:15,658 autolog.py:224] drivier_version: 460.32.03
[2022/08/18 16:57:15] root INFO: drivier_version: 460.32.03
INFO 2022-08-18 16:57:15,658 autolog.py:226] ---------------------- Paddle info ----------------------
[2022/08/18 16:57:15] root INFO: ---------------------- Paddle info ----------------------
INFO 2022-08-18 16:57:15,658 autolog.py:227] paddle_version: 2.3.1
[2022/08/18 16:57:15] root INFO: paddle_version: 2.3.1
INFO 2022-08-18 16:57:15,659 autolog.py:228] paddle_commit: 3cc6ae69ed93388b2648bcc819d593130dede752
[2022/08/18 16:57:15] root INFO: paddle_commit: 3cc6ae69ed93388b2648bcc819d593130dede752
INFO 2022-08-18 16:57:15,659 autolog.py:230] log_api_version: 1.0
[2022/08/18 16:57:15] root INFO: log_api_version: 1.0
INFO 2022-08-18 16:57:15,659 autolog.py:232] ----------------------- Conf info -----------------------
[2022/08/18 16:57:15] root INFO: ----------------------- Conf info -----------------------
INFO 2022-08-18 16:57:15,659 autolog.py:234] runtime_device: gpu
[2022/08/18 16:57:15] root INFO: runtime_device: gpu
INFO 2022-08-18 16:57:15,659 autolog.py:237] ir_optim: True
[2022/08/18 16:57:15] root INFO: ir_optim: True
INFO 2022-08-18 16:57:15,659 autolog.py:238] enable_memory_optim: True
[2022/08/18 16:57:15] root INFO: enable_memory_optim: True
INFO 2022-08-18 16:57:15,659 autolog.py:240] enable_tensorrt: False
[2022/08/18 16:57:15] root INFO: enable_tensorrt: False
INFO 2022-08-18 16:57:15,659 autolog.py:243] enable_mkldnn: False
[2022/08/18 16:57:15] root INFO: enable_mkldnn: False
INFO 2022-08-18 16:57:15,659 autolog.py:246] cpu_math_library_num_threads: 1
[2022/08/18 16:57:15] root INFO: cpu_math_library_num_threads: 1
INFO 2022-08-18 16:57:15,659 autolog.py:249] ----------------------- Model info ----------------------
[2022/08/18 16:57:15] root INFO: ----------------------- Model info ----------------------
INFO 2022-08-18 16:57:15,659 autolog.py:250] model_name: RD$AD
[2022/08/18 16:57:15] root INFO: model_name: RD$AD
INFO 2022-08-18 16:57:15,659 autolog.py:251] precision: fp32
[2022/08/18 16:57:15] root INFO: precision: fp32
INFO 2022-08-18 16:57:15,659 autolog.py:253] ----------------------- Data info -----------------------
[2022/08/18 16:57:15] root INFO: ----------------------- Data info -----------------------
INFO 2022-08-18 16:57:15,659 autolog.py:254] batch_size: 1
[2022/08/18 16:57:15] root INFO: batch_size: 1
INFO 2022-08-18 16:57:15,659 autolog.py:255] input_shape: dynamic
[2022/08/18 16:57:15] root INFO: input_shape: dynamic
INFO 2022-08-18 16:57:15,659 autolog.py:256] data_num: 1
[2022/08/18 16:57:15] root INFO: data_num: 1
INFO 2022-08-18 16:57:15,659 autolog.py:258] ----------------------- Perf info -----------------------
[2022/08/18 16:57:15] root INFO: ----------------------- Perf info -----------------------
INFO 2022-08-18 16:57:15,659 autolog.py:260] cpu_rss(MB): 2523.418, gpu_rss(MB): 1289.0, gpu_util: 0.0%
[2022/08/18 16:57:15] root INFO: cpu_rss(MB): 2523.418, gpu_rss(MB): 1289.0, gpu_util: 0.0%
INFO 2022-08-18 16:57:15,659 autolog.py:262] total time spent(s): 1.4292
[2022/08/18 16:57:15] root INFO: total time spent(s): 1.4292
INFO 2022-08-18 16:57:15,659 autolog.py:264] preprocess_time(ms): 80.8237, inference_time(ms): 1336.724, postprocess_time(ms): 11.6343
[2022/08/18 16:57:15] root INFO: preprocess_time(ms): 80.8237, inference_time(ms): 1336.724, postprocess_time(ms): 11.6343
Outputs saved in checkpoints
效果展示
五、复现心得
安利paddle.vision库,复现cv论文的好帮手,事半功倍。经典的backbone,比如论文用到wideresetnet;ImageFolder的dataset统统开箱即用
此文章为搬运
原项目链接
更多推荐
所有评论(0)