PaddlePaddle / PaddleDetection

Object Detection toolkit based on PaddlePaddle. It supports object detection, instance segmentation, multiple object tracking and real-time multi-person keypoint detection.
Apache License 2.0
12.36k stars 2.84k forks source link

configs/picodet/picodet_s_320_coco.yml配置的AutoAugment: {autoaug_type: v1}训练出错 #4943

Open LMR2018 opened 2 years ago

LMR2018 commented 2 years ago

configs/picodet/picodet_s_320_coco.yml配置的 TrainReader: sample_transforms:

训练命令: python tools/train.py -c configs/picodet/picodet_s_320_coco.yml --eval

(base) F:\murong\projects1\PaddleDetection-release-2.3>python tools/train.py -c configs/picodet/picodet_s_320_coco.yml --eval C:\Users\Dev16\Anaconda3\lib\site-packages\socks.py:58: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working from collections import Callable C:\Users\Dev16\Anaconda3\lib\site-packages\win32\lib\pywintypes.py:2: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses import imp, sys, os C:\Users\Dev16\Anaconda3\lib\site-packages\paddle\tensor\creation.py:130: DeprecationWarning: np.object is a deprecated alias for the builtin object. To silence this warning, use object by itself. Doing this will not modify any b ehavior and is safe. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations if data.dtype == np.object: loading annotations into memory... Done (t=0.01s) creating index... index created! W1218 17:13:32.105926 2104 device_context.cc:447] Please NOTE: device: 0, GPU Compute Capability: 6.1, Driver API Version: 11.1, Runtime API Version: 10.2 W1218 17:13:32.113931 2104 device_context.cc:465] device: 0, cuDNN Version: 7.6. [12/18 17:13:32] reader WARNING: fail to map sample transform [AutoAugment_f7f412] with error: Cannot handle this data type: (1, 1, 4), <f4 and stack: Traceback (most recent call last): File "C:\Users\Dev16\Anaconda3\lib\site-packages\PIL\Image.py", line 2680, in fromarray mode, rawmode = _fromarray_typemap[typekey] KeyError: ((1, 1, 4), '<f4')

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "F:\murong\projects1\PaddleDetection-release-2.3\ppdet\data\reader.py", line 54, in call data = f(data) File "F:\murong\projects1\PaddleDetection-release-2.3\ppdet\data\transform\operators.py", line 105, in call sample = self.apply(sample, context) File "F:\murong\projects1\PaddleDetection-release-2.3\ppdet\data\transform\operators.py", line 594, in apply self.autoaug_type) File "F:\murong\projects1\PaddleDetection-release-2.3\ppdet\data\transform\autoaugment_utils.py", line 1586, in distort_image_with_autoaugment augmentation_hparams) File "F:\murong\projects1\PaddleDetection-release-2.3\ppdet\data\transform\autoaugment_utils.py", line 1548, in build_and_apply_nas_policy tf_policies, image, bboxes) File "F:\murong\projects1\PaddleDetection-release-2.3\ppdet\data\transform\autoaugment_utils.py", line 1496, in select_and_apply_random_policy image, bboxes = policy(image, bboxes) File "F:\murong\projects1\PaddleDetection-release-2.3\ppdet\data\transform\autoaugment_utils.py", line 1540, in finalpolicy prob, bboxes) File "F:\murong\projects1\PaddleDetection-release-2.3\ppdet\data\transform\autoaugment_utils.py", line 1484, in _apply_func_with_prob augmented_image, augmented_bboxes = func(image, bboxes, args) File "F:\murong\projects1\PaddleDetection-release-2.3\ppdet\data\transform\autoaugment_utils.py", line 747, in translate_y_only_bboxes image, bboxes, prob, translate_y, func_changes_bbox, pixels, replace) File "F:\murong\projects1\PaddleDetection-release-2.3\ppdet\data\transform\autoaugment_utils.py", line 706, in _apply_multi_bbox_augmentation_wrapper new_image, new_bboxes, prob, aug_func, func_changes_bbox, args) File "F:\murong\projects1\PaddleDetection-release-2.3\ppdet\data\transform\autoaugment_utils.py", line 687, in _apply_multi_bbox_augmentation idx, (image, new_bboxes) = body(idx, (image, new_bboxes)) File "F:\murong\projects1\PaddleDetection-release-2.3\ppdet\data\transform\autoaugment_utils.py", line 685, in _images_and_bboxes[1])] File "F:\murong\projects1\PaddleDetection-release-2.3\ppdet\data\transform\autoaugment_utils.py", line 655, in wrapped_aug_func = lambda _image, bbox, _new_bboxes: _apply_bbox_augmentation_wrapper(_image, bbox, _new_bboxes, prob, aug_func, func_changes_bbox, args) File "F:\murong\projects1\PaddleDetection-release-2.3\ppdet\data\transform\autoaugment_utils.py", line 611, in _apply_bbox_augmentation_wrapper augmentation_func, args) File "F:\murong\projects1\PaddleDetection-release-2.3\ppdet\data\transform\autoaugment_utils.py", line 535, in _apply_bbox_augmentation augmented_bbox_content = augmentation_func(bbox_content, *args) File "F:\murong\projects1\PaddleDetection-release-2.3\ppdet\data\transform\autoaugment_utils.py", line 857, in translate_y image = Image.fromarray(wrap(image)) File "C:\Users\Dev16\Anaconda3\lib\site-packages\PIL\Image.py", line 2682, in fromarray raise TypeError("Cannot handle this data type: %s, %s" % typekey) TypeError: Cannot handle this data type: (1, 1, 4), <f4

[12/18 17:13:34] ppdet.utils.checkpoint INFO: ['_fc.bias', '_fc.weight', '_last_conv._batch_norm._mean', '_last_conv._batch_norm._variance', '_last_conv._batch_norm.bias', '_last_conv._batch_norm.weight', '_last_conv._conv.weight', 'la st_conv.weight'] in pretrained weight is not used in the model, and its will not be loaded [12/18 17:13:34] ppdet.utils.checkpoint INFO: Finish loading model weights: C:\Users\Dev16/.cache/paddle/weights\ESNet_x0_75_pretrained.pdparams

nemonameless commented 2 years ago

用法参照 https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.3/configs/rcnn_enhance/_base_/faster_rcnn_enhance_reader.yml#L7 所有模型的reader里,Decode都必须是最先做的。

LMR2018 commented 2 years ago

用法参照 https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.3/configs/rcnn_enhance/_base_/faster_rcnn_enhance_reader.yml#L7 所有模型的reader里,Decode都必须是最先做的。

@nemonameless 我已经加上了Decode,但还是报了这个错误,知道什么原因吗? sample_transforms: