Skip to content
Advertisement

Keras flatten: ValueError: Attempt to convert a value (None) with an unsupported type () to a Tensor

I have the error mentioned in the title, with the following code

JavaScript

This sends the following error

JavaScript

According to the question asked with the same error it happens when you mix up keras and tf.keras. But i think have defined the imports accordingly, so unless there is a clash between imports or a bad definition of them i do not think that’s the problem. There is another known solution?

Advertisement

Answer

There’s only 1 bug, Input is not defined but still unrelated to the error mentioned. Use below:

JavaScript

My advice is to please check on the latest versions of tf e.g. 2.4.1.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement