albumentations-team / autoalbument

AutoML for image augmentation. AutoAlbument uses the Faster AutoAugment algorithm to find optimal augmentation policies. Documentation - https://albumentations.ai/docs/autoalbument/

Home Page:https://albumentations.ai/docs/autoalbument/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

assert failed when training second epoch

xuduo35 opened this issue · comments

How can I fix this?

Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/autoalbument/cli/search.py", line 41, in main
faa_searcher.search()
File "/usr/local/lib/python3.8/dist-packages/autoalbument/faster_autoaugment/search.py", line 354, in search
self.save()
File "/usr/local/lib/python3.8/dist-packages/autoalbument/faster_autoaugment/search.py", line 312, in save
self.save_policy()
File "/usr/local/lib/python3.8/dist-packages/autoalbument/faster_autoaugment/search.py", line 274, in save_policy
transform = self.models["policy"].create_transform(
File "/usr/local/lib/python3.8/dist-packages/autoalbument/faster_autoaugment/policy.py", line 195, in create_transform
OneOf([sp.create_transform(input_dtype, p=sub_policy_p) for sp in self.sub_policies], p=1),
File "/usr/local/lib/python3.8/dist-packages/autoalbument/faster_autoaugment/policy.py", line 195, in
OneOf([sp.create_transform(input_dtype, p=sub_policy_p) for sp in self.sub_policies], p=1),
File "/usr/local/lib/python3.8/dist-packages/autoalbument/faster_autoaugment/policy.py", line 88, in create_transform
return A.Sequential([stage.create_transform(input_dtype) for stage in self.stages], p=p)
File "/usr/local/lib/python3.8/dist-packages/autoalbument/faster_autoaugment/policy.py", line 88, in
return A.Sequential([stage.create_transform(input_dtype) for stage in self.stages], p=p)
File "/usr/local/lib/python3.8/dist-packages/autoalbument/faster_autoaugment/policy.py", line 63, in create_transform
assert sum(true_probabilities) <= 1.0
AssertionError

Hey, @xuduo35

I guess that the assertion was triggered because of rounding errors for float probability values. I have released a new version of AutoAlbument (==0.3.1) that will show a RuntimeWarning instead of triggering an assertion in case of incorrect probability values. Generally speaking, probability values slightly above 1.0 should not affect augmentations' performance, but if after the update you will get a RuntimeWarning for incorrect probability values, please report the issue.

Thanks! I'll try later.