Icevision: AttributeError: module 'albumentations' has no attribute 'BboxParams'

Created on 28 Jul 2020  路  7Comments  路  Source: airctic/icevision

Hi folks,
I am literally just executing the advanced guide in Colab (GPU) line by line.
When I execute train_tfm = AlbuTransform([A.Flip()]) I get:

AttributeError                            Traceback (most recent call last)
<ipython-input-19-2627af07b24b> in <module>()
----> 1 train_tfm = AlbuTransform([A.Flip()])

/usr/local/lib/python3.6/dist-packages/mantisshrimp/transforms/albu_transform.py in __init__(self, tfms)
     10         import albumentations as A
     11 
---> 12         self.bbox_params = A.BboxParams(format="pascal_voc", label_fields=["labels"])
     13         super().__init__(tfms=A.Compose(tfms, bbox_params=self.bbox_params))
     14 

AttributeError: module 'albumentations' has no attribute 'BboxParams'

More than happy to dig further if you guys have any guidelines!

bug

Most helpful comment

I found the problem. The problem is Colab uses an old version of albumentations by default in their VMs. This causes an issue.
This feature was not there in old version of albumentations I guess.
Just run
! pip install --upgrade albumentations before and it would run fine.

After upgrading albumentations the code ran fine. I will update this in docs as well. Nice catch @FraPochetti

Here is the Colab notebook I ran.

Do let me know if it works. Cheers !!

All 7 comments

Hey @FraPochetti I will have a look into this. I will try executing this script and let you know where exactly there is bug. You can have a look at our contributing.md here

Also, you are a senior person in the field of DL / ML. Do let us know about your thoughts on this package.

This advanced guide was run as a kaggle kernel by me recently. You can find it here. It ran perfectly and I was able to train the model.
I will look into this issue. I guess something new has broken it.

I found the problem. The problem is Colab uses an old version of albumentations by default in their VMs. This causes an issue.
This feature was not there in old version of albumentations I guess.
Just run
! pip install --upgrade albumentations before and it would run fine.

After upgrading albumentations the code ran fine. I will update this in docs as well. Nice catch @FraPochetti

Here is the Colab notebook I ran.

Do let me know if it works. Cheers !!

I faced this problem before as well!! Maybe we should add this to the docs, we can have a "common errors" section or something like that...
@ai-fast-track what do you think?

Maybe we can add a version specifier (minimum version) for the albumentations package. We also need to update the Advanced Guide to add !pip install --upgrade albumentations.

We can think about the "common errors" section or another alternative in Docs.

Maybe we can add a version specifier (minimum version) for the albumentations package

This is definitely the correct thing to do, @oke-aditya can we specify versions on settings.ini?

We should be able to. I will check it. We can define that in setup.py. But I guess it should be able to automatically choose proper version from our .whl itself.

I will create a fresh conda env and try running it. If it works we are good. I expect it to figure out correct version through setup.py

Thanks for looking into this @oke-aditya !
It seems to work now.

Also, you are a senior person in the field of DL / ML. Do let us know about your thoughts on this package.

You are over-estimating me man 馃榿 ! I will definitely let you guys know. I am gonna take the library for a spin starting tomorrow.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lgvaz picture lgvaz  路  3Comments

tugot17 picture tugot17  路  5Comments

ncduy0303 picture ncduy0303  路  3Comments

lgvaz picture lgvaz  路  4Comments

oke-aditya picture oke-aditya  路  5Comments