Skip to content

bug fixed - #2

Open
danialht wants to merge 1 commit into
giannisdaras:mainfrom
danialht:fix-corruptions-dict
Open

danialht wants to merge 1 commit into
giannisdaras:mainfrom
danialht:fix-corruptions-dict

Conversation

@danialht

Copy link
Copy Markdown

In SyntheticallyCorruptedImageFolderDataset constructor, the default value for corruptions_dict was a mutable, which can result in unexpected behavior. Classic Python gotcha, but now is fixed.

Furthermore, non-zero corruption_probability with an empty dict, e.g. the default value, would lead to a ValueError the first time that the corruption is triggered in __get_item__ because np.random.choice would raise ValueError when passed an empty list. Instead for this situation we can fail faster in the constructor than to fail lazily in __get_item__.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant