DeepForest icon indicating copy to clipboard operation
DeepForest copied to clipboard

Google Colab example errors with `ImportError: cannot import name 'functional' from 'albumentations'`

Open ivyleavedtoadflax opened this issue 3 years ago • 2 comments

Describe the bug Trying to run the colab linked to in README errors with: ImportError: cannot import name 'functional' from 'albumentations'

To Reproduce

  1. Open https://colab.research.google.com/drive/1gKUiocwfCvcvVfiKzAaf6voiUVL2KK_r?usp=sharing in your browser
  2. Select runtime > change runtime type > GPU
  3. Select runtime > run all

Environment (please complete the following information): Google colab

Screenshots image

Additional context Add any other context about the problem here.

ivyleavedtoadflax avatar Jul 11 '22 20:07 ivyleavedtoadflax

the installed albumentations is too old. I have tried albumentations version 1.0.0 (and btw a newer opencv like 4.6.0 is also necessary) and it works

probably a careful environment.yml can avoid such problem.

easz avatar Jul 11 '22 21:07 easz

Thanks, yep, if you have a pinned set of dependencies, that would be a great help!

ivyleavedtoadflax avatar Jul 12 '22 10:07 ivyleavedtoadflax

@ivyleavedtoadflax is there an update to conda env we should make? I think this only a case on colab which has a version of things pre-installed, but which are old. I haven't heard of this other than that case.

bw4sz avatar Aug 30 '22 16:08 bw4sz

It would be good if you could pin the requirements so that there is a specific version for each package listed in https://github.com/weecology/DeepForest/blob/main/environment.yml, or add a pinned set of dependencies with something like pip freeze > requirements.txt (I don't use conda, so I don't know the conda equivalent, but i'm sure there is one). Otherwise a user will end up with a different environment if they install the dependencies today and then do it again next week, solely due to the changes in the dependencies.

ivyleavedtoadflax avatar Sep 01 '22 11:09 ivyleavedtoadflax

I've submitted a PR with the noted minimum version updates. I don't think we generally want to force the use of specific versions of packages unless necessary because it can make working with other packages more challenging.

ethanwhite avatar Sep 01 '22 14:09 ethanwhite