In this tutorial, we will introduce how to fix ValueError: Tried to convert ‘x’ to a tensor and failed. Error: None values not supported when training a tensorflow model.
Our code is here:
audio_emb_out = self.audio_model.get_audio_emb(self.audio_input_x) audio_emb_out = tf.tanh(audio_emb_out) audio_emb_out = tf.nn.dropout(audio_emb_out, self.prob)
This value error is:
Why this value error occur?
From the error report, we can find: None values not supported. It means tf.tanh() may received a None value.
Check function self.audio_model.get_audio_emb(), we found there are no any variables returned by this function. It means self.audio_model.get_audio_emb() will return None.
It is easy to fix this error: make this function return a tensor.