Skip to content Skip to sidebar Skip to footer

Tensorflow (Keras API) `model.fit` Method Returns "Failed To Convert Object Of Type To Tensor" Error

I am using gaussian noise per the tf.random.normal method (or K.random_normal via the keras API). It is used from within a custom tensorflow Layer, which, in turn, is used by a cus

Solution 1:

In the call method, instead of using keras.backend to get batch and dim, use tensorflow directly.

batch = tf.shape(inputs)[0]
dim = tf.shape(inputs)[1]

Post a Comment for "Tensorflow (Keras API) `model.fit` Method Returns "Failed To Convert Object Of Type To Tensor" Error"