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

Version Errors #35

Closed SilverHawk2020 closed 3 years ago

SilverHawk2020 commented 4 years ago

Lines 302 to 312 should be like that (Add tf.compat.v1)

    config =tf.compat.v1.ConfigProto(
        inter_op_parallelism_threads=BLAS_thread_count
    )

    os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
    import logging
    logging.getLogger('tensorflow').setLevel(logging.FATAL)

    with SuppressStdoutAndStderr():
        from keras import backend as k
        session =tf.compat.v1.Session()(config=config)

https://github.com/DCASE-REPO/dcase_util/blob/0e35c3cf1aeb13d25a82ac0ea8a77d1b7f2eff62/dcase_util/keras/utils.py#L312

toni-heittola commented 3 years ago

This issue is related to Keras versions. This has been resolved in commit b72f46629468981339c43c25b720411f73e61851 by introducing tfkeras utilities to be used with Keras 2.x which is included in the TensorFlow framework.