Spleeter: [Bug] Spleeter fails to import tensorflow due to a missing TF attribute 'compat'

Created on 24 Jun 2020  路  5Comments  路  Source: deezer/spleeter

Description

After installing Spleeter with Conda on Windows 10, I cannot make it execute as it fails to import tensorflow.

Step to reproduce

  1. Installed using conda install -c conda-forge spleeter
  2. Run as spleeter separate -i "path\file.flac" -p spleeter:2stems-16kHz -o y:\audio_output
  3. Got AttributeError: module 'tensorflow' has no attribute 'compat error

Obs: This can be reproduced by running python and typing import tensorflow as well.

Output

Traceback (most recent call last):
  File "C:\Users\bsbla\Anaconda3\Scripts\spleeter-script.py", line 10, in <module>
    sys.exit(entrypoint())
  File "C:\Users\bsbla\Anaconda3\lib\site-packages\spleeter\__main__.py", line 54, in entrypoint
    main(sys.argv)
  File "C:\Users\bsbla\Anaconda3\lib\site-packages\spleeter\__main__.py", line 36, in main
    enable_logging()
  File "C:\Users\bsbla\Anaconda3\lib\site-packages\spleeter\utils\logging.py", line 60, in enable_logging
    tf_logger = get_tensorflow_logger()
  File "C:\Users\bsbla\Anaconda3\lib\site-packages\spleeter\utils\logging.py", line 27, in get_tensorflow_logger
    from tensorflow.compat.v1 import logging
  File "C:\Users\bsbla\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 99, in <module>
    from tensorflow_core import *
  File "C:\Users\bsbla\Anaconda3\lib\site-packages\tensorflow_core\__init__.py", line 42, in <module>
    from tensorflow._api.v1 import compat
  File "C:\Users\bsbla\Anaconda3\lib\site-packages\tensorflow_core\_api\v1\compat\__init__.py", line 23, in <module>
    from tensorflow._api.v1.compat import v1
  File "C:\Users\bsbla\Anaconda3\lib\site-packages\tensorflow_core\_api\v1\compat\v1\__init__.py", line 672, in <module>
    from tensorflow_estimator.python.estimator.api._v1 import estimator
  File "C:\Users\bsbla\Anaconda3\lib\site-packages\tensorflow_estimator\__init__.py", line 10, in <module>
    from tensorflow_estimator._api.v1 import estimator
  File "C:\Users\bsbla\Anaconda3\lib\site-packages\tensorflow_estimator\_api\v1\estimator\__init__.py", line 10, in <module>
    from tensorflow_estimator._api.v1.estimator import experimental
  File "C:\Users\bsbla\Anaconda3\lib\site-packages\tensorflow_estimator\_api\v1\estimator\experimental\__init__.py", line 10, in <module>
    from tensorflow_estimator.python.estimator.canned.dnn import dnn_logit_fn_builder
  File "C:\Users\bsbla\Anaconda3\lib\site-packages\tensorflow_estimator\python\estimator\canned\dnn.py", line 33, in <module>
    from tensorflow_estimator.python.estimator import estimator
  File "C:\Users\bsbla\Anaconda3\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 53, in <module>
    from tensorflow_estimator.python.estimator import util as estimator_util
  File "C:\Users\bsbla\Anaconda3\lib\site-packages\tensorflow_estimator\python\estimator\util.py", line 75, in <module>
    class _DatasetInitializerHook(tf.compat.v1.train.SessionRunHook):
AttributeError: module 'tensorflow' has no attribute 'compat

Environment

| | |
| ----------------- | ------------------------------- |
| OS | Windows 10 Insider Dev/Fast 20150 |
| Installation type | Conda |
| RAM available | 7.7GB / 16.0GB |
| Hardware spec | Intel Core i3 8100 3.6Ghz 4C/4T / 16GB DDR4 2400mhz / NVIDIA GTX 1660 6GB / SSD for Main OS |

Additional context

Does not happen if I install through pip.

https://github.com/tensorflow/tensorflow/issues/37525

Similar as above... Perhaps tensorflow needs to be updated or something?

bug invalid

Most helpful comment

Related to #429 - it seems to be a package dependency issue in the release.
The workaround in the other ticket was to install v1.4.9 which has confirmed to work.
conda install -c conda-forge spleeter=1.4.9

All 5 comments

Same problem. As a workaround, I installed the previous version of Spleeter "conda install -c conda-forge/label/cf202003 spleeter" and then I succesfully installed the last release "conda install -c conda-forge spleeter"

Related to #429 - it seems to be a package dependency issue in the release.
The workaround in the other ticket was to install v1.4.9 which has confirmed to work.
conda install -c conda-forge spleeter=1.4.9

Related to #429 - it seems to be a package dependency issue in the release.
The workaround in the other ticket was to install v1.4.9 which has confirmed to work.
conda install -c conda-forge spleeter=1.4.9

Installing this version is causing the following error for me when I try to launch Spleeter:
Fatal error in launcher: Unable to create process using '"d:\bld\spleeter_1577456344482_h_envpython.exe" "C:\Code\Miniconda3\Scripts\spleeter.exe" '

Spleeter 1.5.3 ran OK but got the "compat" error mentioned above.

Ok, I reproduced the issue:
for some reasons, conda installs tensorflow-estimator v2.2.0 together with tensorflow v1.15.0 and they seem to be incompatible versions. We'll probably fix it by adding an explicit dependency on tensorflow-estimator v1.15.1 in the conda recipe.
In the meantime, you can fix the installation by installing tensorflow-estimator v1.15.1 with conda after the installation of spleeter:
First install spleeter:

conda install -c conda-forge spleeter

Here you should get the "compat" error.
Then downgrade tensorflow-estimator to 1.15.1:

conda install tensorflow-estimator=1.15.1

The "compat" error should then have disappeared.

I updated the conda package adding the explicit dependency.
The installation of spleeter with conda should be back to normal:

conda install -c conda-forge spleeter
Was this page helpful?
0 / 5 - 0 ratings

Related issues

geraldoramos picture geraldoramos  路  4Comments

Rahul-Sindhu picture Rahul-Sindhu  路  4Comments

aidv picture aidv  路  4Comments

Rohan-Kishibe picture Rohan-Kishibe  路  5Comments

brunobulgaron picture brunobulgaron  路  5Comments