tensorflow / tensorflow/datasets
`Imagenet2012CorruptedTest.test_download_and_prepare_as_dataset` is broken
@ndl is already working on this.
Since Jan 17, 2022.
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 1.6k
- Avg merge
- 3h 54m
- Merged PRs (30d)
- 1
Description
Short description
Imagenet2012CorruptedTest.test_download_and_prepare_as_dataset test gives an error FileNotFoundError: [Errno 2] No such file or directory: 'imagemagick' despite ImageMagick being installed. After that particular issue is patched, the next error is AttributeError: module 'cv2' has no attribute 'CVX_8U'.
Environment information
-
Operating Systems: both Ubuntu 22.04 (in docker with
virtualenv) and NixOS 21.11 withnixpkgson 'master'. -
Python version: 3.9.9
-
tensorflow-datasets/tfds-nightlyversion: 4.4.0 -
tensorflow/tf-nightlyversion: 2.7.0 -
Does the issue still exists with the last
tfds-nightlypackage (pip install --upgrade tfds-nightly) ? Yes.
Reproduction instructions
pytest ./tensorflow_datasets/image_classification/imagenet2012_corrupted_test.py
Expected behavior
The test succeeds.
Additional context
There seem to be two problems with the tensorflow_datasets/image_classification/corruptions.py implementation:
- Most (all?) distributions call ImageMagick binary
convert(for v6.x) ormagick(but typically withconvertas a link to it, for v7.x), I'm not sure which one usesimagemagickbinary name =>imagemagickshould be replaced withconvert. - The code uses the constant
CVX_8Uwhich, I believe, doesn't exist and is a typo? =>CVX_8Ushould be replaced withCV_8U.
When both of these problems are fixed - the tests succeeds. See also the patch pkgs/development/python-modules/tensorflow-datasets/corruptions.patch in https://github.com/NixOS/nixpkgs/pull/154117 LMK if you want me to create a pull request against tensorflow-datasets with this patch applied.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.