tensorflow InvalidArgumentError 错误处理

tensorflow.python.framework.errors_impl.InvalidArgumentError: Expected image (JPEG, PNG, or GIF), got unknown format starting with '!(5#*8)->+-?*,>*'

[[Node: DecodeJpeg = DecodeJpeg[acceptable_fraction=1, channels=0, dct_method="", fancy_upscaling=true, ratio=1, try_recover_truncated=false](ParseSingleExample/Squeeze_image_raw)]]

[[Node: IteratorGetNext = IteratorGetNext[output_shapes=[[?,128,128,3], [?]], output_types=[DT_FLOAT, DT_INT64], _device="/job:localhost/replica:0/task:0/device:CPU:0"](Iterator)]]

在tensorflow1.4下
用tensorflow 将opencv的image转换为byte后用tfrecord储存

读取tfrecord时 用tf.FixedLenFeature([], tf.string)处理features

最后使用tf.image.decode_jpeg(features['image_raw'])处理得到的tf.string

报如上错误。在tensorflow1.4下decode_jpeg无法处理字符转图片的情况?

使用tf.decode_raw(features['image_raw'],tf.uint8)后运行正常.......

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值