question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
FraPochetticommented, Oct 26, 2020

I also tested the change (e.g. params["masks"] = list(masks.data)) with albumentations version 0.4.6 and it still works, so it looks backwards compatible.

1reaction
lgvazcommented, Oct 26, 2020

This line should look like params[“masks”] = list(masks.data)

Interesting, for some reason they decided not to accept a numpy array anymore?

Before I create a PR, does this make sense to you?

Yeah yeah! To get the tests passing were the only thing required on this one

I mean, in the same PR.

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found