数据增强报错
Created by: ljx111
两个数据增强操作RandomDistort 、ExpandImage加上后报错,请问一下这是什么问题导致的? 以下是部分配置信息:
TrainReader:
inputs_def:
fields: ['image', 'im_info', 'im_id', 'gt_bbox', 'gt_class', 'is_crowd']
dataset:
!PolypsDataSet
image_dir: image_train
anno_path: label_train__.txt
dataset_dir: dataset/polyps/data
sample_transforms:
- !DecodeImage
to_rgb: true
- !NormalizeImage
is_channel_first: false
is_scale: true
mean: [0.485,0.456,0.406]
std: [0.229, 0.224,0.225]
- !ResizeImage
target_size: 512
max_size: 1333
interp: 1
use_cv2: true
- !RandomFlipImage
prob: 0.5
- !RandomDistort ###
brightness_lower: 0.75
brightness_upper: 1.5
contrast_lower: 0.75
contrast_upper: 1.5
saturation_lower: 0.5
saturation_upper: 1.5
hue_lower: -18
hue_upper: 18
brightness_prob: 0.5
contrast_prob: 0.5
saturation_prob: 0.5
hue_prob: 0.5
count: 4
is_order: False
- !ExpandImage ###
max_ratio: 1.25
mean: [123.675, 116.28, 103.53]
prob: 0.5
- !RandomCrop
aspect_ratio: [.5, 2.]
thresholds: [.0, .1, .3, .5, .7, .9]
scaling: [.3, 1.]
- !MixupImage
alpha: 1.5
beta: 1.5
- !Permute
to_bgr: false
channel_first: true
batch_transforms:
- !PadBatch
pad_to_stride: 32
use_padded_im_info: false
batch_size: 16
shuffle: true
worker_num: 2
use_process: false
以下是报名信息:
2020-06-14 23:50:30,323-INFO: places would be ommited when DataLoader is not iterable
W0614 23:50:31.137933 1011 device_context.cc:237] Please NOTE: device: 0, CUDA Capability: 70, Driver API Version: 10.1, Runtime API Version: 9.0
W0614 23:50:31.141782 1011 device_context.cc:245] device: 0, cuDNN Version: 7.3.
2020-06-14 23:50:32,759-INFO: Load model and fuse batch norm if have from http://paddle-imagenet-models-name.bj.bcebos.com/ResNet101_pretrained.tar...
2020-06-14 23:50:32,759-INFO: Found /home/aistudio/.cache/paddle/weights/ResNet101_pretrained
2020-06-14 23:50:32,767-INFO: Loading parameters from /home/aistudio/.cache/paddle/weights/ResNet101_pretrained...
2020-06-14 23:50:32,768-WARNING: /home/aistudio/.cache/paddle/weights/ResNet101_pretrained.pdparams not found, try to load model file saved with [ save_params, save_persistables, save_vars ]
2020-06-14 23:50:32,768-WARNING: /home/aistudio/.cache/paddle/weights/ResNet101_pretrained.pdparams not found, try to load model file saved with [ save_params, save_persistables, save_vars ]
2020-06-14 23:50:32,778-WARNING: variable file [ /home/aistudio/.cache/paddle/weights/ResNet101_pretrained/fc_0.w_0 /home/aistudio/.cache/paddle/weights/ResNet101_pretrained/fc_0.b_0 ] not used
2020-06-14 23:50:32,778-WARNING: variable file [ /home/aistudio/.cache/paddle/weights/ResNet101_pretrained/fc_0.w_0 /home/aistudio/.cache/paddle/weights/ResNet101_pretrained/fc_0.b_0 ] not used
2020-06-14 23:50:33,142-INFO: places would be ommited when DataLoader is not iterable
I0614 23:50:33.165014 1011 parallel_executor.cc:440] The Program will be executed on CUDA using ParallelExecutor, 1 cards are used, so 1 programs are executed in parallel.
I0614 23:50:33.210036 1011 build_strategy.cc:365] SeqOnlyAllReduceOps:0, num_trainers:1
I0614 23:50:33.329967 1011 parallel_executor.cc:307] Inplace strategy is enabled, when build_strategy.enable_inplace = True
I0614 23:50:33.363153 1011 parallel_executor.cc:375] Garbage collection strategy is enabled, when FLAGS_eager_delete_tensor_gb = 0
2020-06-14 23:50:33,391-INFO: fail to map op [RandomDistort_67107d] with error: Cannot handle this data type and stack:
Traceback (most recent call last):
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/PIL/Image.py", line 2645, in fromarray
mode, rawmode = _fromarray_typemap[typekey]
KeyError: ((1, 1, 3), '<f4')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/aistudio/work/PaddleDetection/ppdet/data/reader.py", line 45, in __call__
data = f(data, ctx)
File "/home/aistudio/work/PaddleDetection/ppdet/data/transform/operators.py", line 597, in __call__
im = Image.fromarray(im)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/PIL/Image.py", line 2647, in fromarray
raise TypeError("Cannot handle this data type")
TypeError: Cannot handle this data type
2020-06-14 23:50:33,392-WARNING: recv endsignal from outq with errmsg[consumer[consumer-1ea-1] failed to map with error:[Cannot handle this data type]]
2020-06-14 23:50:33,392-INFO: fail to map op [RandomDistort_67107d] with error: Cannot handle this data type and stack:
Traceback (most recent call last):
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/PIL/Image.py", line 2645, in fromarray
mode, rawmode = _fromarray_typemap[typekey]
KeyError: ((1, 1, 3), '<f4')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/aistudio/work/PaddleDetection/ppdet/data/reader.py", line 45, in __call__
data = f(data, ctx)
File "/home/aistudio/work/PaddleDetection/ppdet/data/transform/operators.py", line 597, in __call__
im = Image.fromarray(im)
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/PIL/Image.py", line 2647, in fromarray
raise TypeError("Cannot handle this data type")
TypeError: Cannot handle this data type