Description
build_dataset接口(task='det', phase='train', is_train=False) (task='det', phase='train', is_train=True)这两个组合用例失败
根本原因是
mindocr/requirements.txt 文件下的imgaug 没用指定版本号,版本号低就会报错,需要在requirements.txt 指定imgaug的版本;额外建议如果其他依赖有版本要求,最好也把版本号加上。
详细报错如下:
task = 'det', phase = 'train', is_train = False, verbose = True
@pytest.mark.level('level0')
def test_build_dataset_003(task='det', phase='train', is_train=False, verbose=True):
"""
test_build_dataset_003 test case
"""
set_proxy()
ut_dir = "test_build_dataset_003"
net_dir = os.path.join(mindocr_models_test_data, "interfaces")
specific_dir = prepare_dir(net_dir, ut_dir)
config_fp = os.path.join(mindocr_path, 'configs/det/dbnet/db_r50_icdar15.yaml')
dataset_root = gen_dummpy_data(task, net_dir)
yaml_fp = update_config(config_fp, task, dataset_root, specific_dir)
with open(yaml_fp) as fp:
cfg = yaml.safe_load(fp)
dataset_config = cfg[phase]['dataset']
loader_config = cfg[phase]['loader']
dl = build_dataset(dataset_config, loader_config, is_train=is_train)
PyTest/testcase/mindocr/interfaces/test_build_dataset.py:183:
/opt/buildtools/python-3.9.11/lib/python3.9/site-packages/mindocr/data/builder.py:109: in build_dataset
dataset = dataset_class(**dataset_args)
/opt/buildtools/python-3.9.11/lib/python3.9/site-packages/mindocr/data/det_dataset.py:77: in init
_data = run_transforms(_data, transforms=self.transforms)
/opt/buildtools/python-3.9.11/lib/python3.9/site-packages/mindocr/data/transforms/transforms_factory.py:60: in run_transforms
data = transform(data)
/opt/buildtools/python-3.9.11/lib/python3.9/site-packages/mindocr/data/transforms/iaa_augment.py:20: in call
kps = aug.augment_keypoints(kps)
/opt/buildtools/python-3.9.11/lib/python3.9/site-packages/imgaug/augmenters/meta.py:804: in augment_keypoints
ia.do_assert(ia.is_iterable(keypoints_on_images))
condition = False, message = 'Assertion failed.'
def do_assert(condition, message="Assertion failed."):
"""
Function that behaves equally to an `assert` statement, but raises an
Exception.
This is added because `assert` statements are removed in optimized code.
It replaces `assert` statements throughout the library that should be
kept even in optimized code.
Parameters
----------
condition : bool
If False, an exception is raised.
message : str, optional
Error message.
"""
if not condition:
raise AssertionError(str(message))
E AssertionError: Assertion failed.
/opt/buildtools/python-3.9.11/lib/python3.9/site-packages/imgaug/imgaug.py:1530: AssertionError