def load(image_file):
image = tf.io.read_file(image_file)
# image = tf.image.decode_jpeg(image)
image = tf.image.decode_png(image)
在深度学习加载图片过程中,最开始用jpg图片测试代码,发现没有错误,换成png就一直报错,很(ˉ▽ˉ;)...
报错内容如下
Traceback (most recent call last):
File "E:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\ops\gen_io_ops.py", line 627, in read_file
name, _ctx._post_execution_callbacks, filename)
tensorflow.python.eager.core._FallbackException: This function does not handle the case of the path where all inputs are not already EagerTensors.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2961, in run_code
exec(code_obj, self.user_global_ns, self.user