ERROR Keras Network Learner 0:14 Tensor is unhashable if Tensor equality is enabled. Instead, use tensor.experimental_ref() as the key.

Hi,

I am getting the following error:

ERROR Keras Network Learner 0:14 Tensor is unhashable if Tensor equality is enabled. Instead, use tensor.experimental_ref() as the key.
Traceback (most recent call last):
File “”, line 5, in
File “/home/user/Desktop/knime_4.1.0/plugins/org.knime.dl.python_4.1.0.v201909231406/py/DLPythonNetworkSpecToDataFrameConverter.py”, line 96, in get_layer_data_specs_as_data_frames
extractor = DLPythonNetworkSpecToDataFrameConverter(network.spec)
File “/home/user/Desktop/knime_4.1.0/plugins/org.knime.dl.keras_4.1.0.v201911110939/py/DLKerasNetwork.py”, line 150, in spec
self._spec = self._extract_model_spec()
File “/home/user/Desktop/knime_4.1.0/plugins/org.knime.dl.keras_4.1.0.v201911110939/py/DLKerasTensorFlowNetwork.py”, line 87, in _extract_model_spec
return DLKerasTensorFlowNetworkSpecExtractor(self._model).extract_spec()
File “/home/user/Desktop/knime_4.1.0/plugins/org.knime.dl.keras_4.1.0.v201911110939/py/DLKerasNetworkSpecExtractor.py”, line 95, in extract_spec
self._extract_node_input_tensor_specs(layer, node_idx)
File “/home/user/Desktop/knime_4.1.0/plugins/org.knime.dl.keras_4.1.0.v201911110939/py/DLKerasNetworkSpecExtractor.py”, line 149, in _extract_node_input_tensor_specs
if input_tensor in self._model_inputs and input_tensor not in self._visited_inputs:
File “/home/user/anaconda3/lib/python3.7/site-packages/tensorflow_core/python/framework/ops.py”, line 713, in hash
raise TypeError("Tensor is unhashable if Tensor equality is enabled. "
TypeError: Tensor is unhashable if Tensor equality is enabled. Instead, use tensor.experimental_ref() as the key.

ERROR Keras Network Learner 0:14 Execute failed: An error occurred while creating the Keras network from its layer specifications.
This could be due to a version mismatch between Keras and TensorFlow.
Please make sure that Keras 2.1.6 and TensorFlow 1.8.0 are installed in your Python environment.
See log for details.
You can install the correct version of Keras and TensorFlow on the ‘Python Deep Learning’ preference page.

Please help.

Thanks and Regards,
Madhu

Hi Madhu,

What versions of Keras and TensorFlow are you running? Is it Keras 2.1.6 and TensorFlow 1.8.0 as suggested in the error message? If not, could you try to replace them with these versions?

Marcel

Hi Marcel,

As I have newer versions of keras and tensorflow, could you please let me know if I still have to replace them to older versions?

My
Keras Version : 2.3.1
Tensorflow Version: 2.0.0

Thanks and Regards,
Madhu

Hi Madhu,

Yes, you still need to replace them. KNIME currently does not (yet) support TensorFlow 2 and the corresponding Keras versions.

Marcel

4 Likes

Hi Marcel,

Thank you.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.