TensorFlow TypeError: Value Passed To Parameter Input Has DataType Uint8 Not In List Of Allowed Values: Float16, Float32
I am trying to get a simple CNN to train for the past 3 days. First, I have setup an input pipeline/queue configuration that reads images from a directory tree and prepares batch
Solution 1:
The image from your input pipeline is of type 'uint8', you need to type cast it to 'float32', You can do this after the image jpeg decoder:
image = tf.image.decode_jpeg(...
image = tf.cast(image, tf.float32)
Solution 2:
You need to cast your image from int
to float
, You can simply do so for your input images.
image = image.astype('float')
It works fine with me.
Post a Comment for "TensorFlow TypeError: Value Passed To Parameter Input Has DataType Uint8 Not In List Of Allowed Values: Float16, Float32"