DCASE-REPO / dcase_util

A collection of utilities for Detection and Classification of Acoustic Scenes and Events
https://dcase-repo.github.io/dcase_util/
MIT License
127 stars 33 forks source link

keras error when using new dcase_util 0.2.13 #31

Closed arunodhayan closed 4 years ago

arunodhayan commented 4 years ago

File "/src/task1a.py", line 683, in do_learning print_indent=2 File "/usr/local/lib/python3.6/dist-packages/dcase_util/decorators/decorators.py", line 14, in call return self.f(*args, **kwargs) File "/usr/local/lib/python3.6/dist-packages/dcase_util/keras/utils.py", line 308, in setup_keras keras.backend.tensorflow_backend.set_session(tf.Session(config=config)) UnboundLocalError: local variable 'keras' referenced before assignment

toni-heittola commented 4 years ago

There is something wrong here, the master branch of this repository is currently in sync with version 0.2.13, however, code line 308 which is producing your error is different in the released version > https://github.com/DCASE-REPO/dcase_util/blob/master/dcase_util/keras/utils.py#L308

Are you sure you are using version 0.2.13 ?

arunodhayan commented 4 years ago

[E] Uncaught exception (logging.py:221) Traceback (most recent call last): File "task1b.py", line 680, in sys.exit(main(sys.argv)) File "task1b.py", line 234, in main overwrite=overwrite File "/src/task1a.py", line 683, in do_learning print_indent=2 File "/usr/local/lib/python3.6/dist-packages/dcase_util/decorators/decorators.py", line 14, in call return self.f(*args, **kwargs) File "/usr/local/lib/python3.6/dist-packages/dcase_util/keras/utils.py", line 308, in setup_keras keras.backend.tensorflow_backend.set_session(tf.Session(config=config)) UnboundLocalError: local variable 'keras' referenced before assignment

toni-heittola commented 4 years ago

Ok, this should be fixed now. You just have to update dcase_util to version 0.2.14 version and it should work. The PIP package for version 0.2.13 was for some reason not in sync with the repository.

arunodhayan commented 4 years ago

its working now ty