TypeError: Value passed to parameter ‘input’ has DataType uint8 not in list of allowed values: float16, bfloat16, float32, float64
报错代码
img = unet.predict(img)
报错信息
TypeError: Value passed to parameter 'input' has DataType uint8 not in list of allowed values: float16, bfloat16, float32, float64
解决办法
img = tf.cast(img, tf.float32)
img = unet.predict(img)
上一行加入转换类型代码