首页 > 解决方案 > 在 tensorflow 1.12 中读取 uint16 图像的奇怪问题

问题描述

我目前正在做一个光流项目,我遇到了一个奇怪的错误。

我的 TFrecords 中有 uint16 图像以字节形式存储。当我从本地机器读取 TFrecords 时,它给了我 uint16 值,但是当我部署相同的代码并从 docker 读取它时,即使我的 dtype 是 uint16,我也会得到 uint8 值。我的意思是 uint16 值正在减少到像 32768 --> 128 这样的 uint8。

是什么导致了这个错误?

我的本地机器有:Tensorflow 1.10.1 和 python 3.6 我的 Docker 映像有:Tensorflow 1.12.0 和 python 3.5

我正在研究 tensorflow 对象检测 API 在创建我使用的 TF 记录时:

with tf.gfile.GFile(flows, 'rb') as fid:
    flow_images = fid.read()

在读回来时,我正在使用:tf.image.decoderaw

数据集:KITTI FLOW 2015

标签: python-3.xdockertensorflowopticalflowuint16

解决方案


推荐阅读