[Update] Albumentations 0.5.0
See original GitHub issue🐛 Bug
The new release of albumentations 0.5.0 introduced breaking changes, the error is currently being avoided by specifying a version lower than 0.5.0 in setup.cfg
How to reproduce
Update albumentations and run: pytest tests/transforms/test_albu_transform.py
Stracktrace
internal_data_name = 'masks'
def _check_args(self, **kwargs):
checked_single = ["image", "mask"]
checked_multi = ["masks"]
# ["bboxes", "keypoints"] could be almost any type, no need to check them
for data_name, data in kwargs.items():
internal_data_name = self.additional_targets.get(data_name, data_name)
if internal_data_name in checked_single:
if not isinstance(data, np.ndarray):
raise TypeError("{} must be numpy array type".format(data_name))
if internal_data_name in checked_multi:
> if data:
E ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
/opt/hostedtoolcache/Python/3.6.12/x64/lib/python3.6/site-packages/albumentations/core/composition.py:223: ValueError
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
albumentations 0.5.0 - PyPI
Easy to extend the library to wrap around other libraries. Easy to extend to other tasks. Supports transformations on images, masks, key points ......
Read more >Installation - Albumentations Documentation
Albumentations requires Python 3.6 or higher. Install the latest stable version from PyPI¶. pip install -U albumentations. Install the latest version ...
Read more >Inception-v3 - Kaggle
0: Successfully uninstalled albumentations-0.5.0 Successfully installed albumentations-0.5.2 WARNING: You are using pip version 20.2.4; however, version 20.3.3 ...
Read more >Albumentations - :: Anaconda.org
noarch v1.3.0. conda install. To install this package run one of the following: conda install -c conda-forge albumentations
Read more >albumentations Documentation
uint8 data type to the. VerticalFlip augmentation and we expect that it won't change data types of inputs and will produce an image...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I also tested the change (e.g.
params["masks"] = list(masks.data)
) withalbumentations
version0.4.6
and it still works, so it looks backwards compatible.Interesting, for some reason they decided not to accept a numpy array anymore?
Yeah yeah! To get the tests passing were the only thing required on this one
Yes, both changes in the same PR, but instead of removing the condition put it
<0.6
, so it doesn’t break unexpectedly in the future