marl / openl3

OpenL3: Open-source deep audio and image embeddings
MIT License
456 stars 58 forks source link

Failed to construct network. Tried both Tensorflow 2.0.0 and 1.9.5, Keras2.3.1 and 2.2.5 #43

Closed zhao-shuyang closed 4 years ago

zhao-shuyang commented 4 years ago

openl3.models._construct_mel128_audio_network() WARNING:tensorflow:From /home/zhaos/anaconda3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:66: The name tf.get_default_graph is deprecated. Please use tf.compat.v1.get_default_graph instead.

WARNING:tensorflow:From /home/zhaos/anaconda3/lib/python3.7/site-packages/keras/backend/tensorflow_backend.py:541: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

WARNING:tensorflow:From /home/zhaos/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/ops/resource_variable_ops.py:1630: calling BaseResourceVariable.init (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version. Instructions for updating: If using Keras pass _constraint arguments to layers. Traceback (most recent call last): File "", line 1, in File "/home/zhaos/anaconda3/lib/python3.7/site-packages/openl3/models.py", line 265, in _construct_mel128_audio_network y_a = Melspectrogram(n_dft=n_dft, n_hop=n_hop, n_mels=n_mels, sr=asr, power_melgram=1.0, htk=True, return_decibel_melgram=True, padding='same')(x_a) File "/home/zhaos/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/base_layer.py", line 881, in call inputs, outputs, args, kwargs) File "/home/zhaos/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/base_layer.py", line 2043, in _set_connectivitymetadata input_tensors=inputs, output_tensors=outputs, arguments=arguments) File "/home/zhaos/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/base_layer.py", line 2059, in _add_inbound_node input_tensors) File "/home/zhaos/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/util/nest.py", line 536, in map_structure structure[0], [func(x) for x in entries], File "/home/zhaos/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/util/nest.py", line 536, in structure[0], [func(*x) for x in entries], File "/home/zhaos/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/base_layer.py", line 2058, in inbound_layers = nest.map_structure(lambda t: t._keras_history.layer, AttributeError: 'tuple' object has no attribute 'layer'

justinsalamon commented 4 years ago

The current version of openl3 does not support TF 2.x. We're working towards an update for this.

In the meanwhile, here's a version combination that is known to work:

auroracramer commented 4 years ago

Resolved by #44