train.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:neuroimage-tensorflow 作者: corticometrics 项目源码 文件源码
def read_and_decode(filename_queue):
    reader = tf.TFRecordReader()
    _, serialized_example = reader.read(filename_queue)
    features = tf.parse_single_example(serialized_example,features={
        'image_raw': tf.FixedLenFeature([], tf.string),
        'label_raw': tf.FixedLenFeature([], tf.string)})
    image  = tf.cast(tf.decode_raw(features['image_raw'], tf.int16), tf.float32)
    labels = tf.decode_raw(features['label_raw'], tf.int16)

    #PW 2017/03/03: Zero-center data here?
    image.set_shape([IMG_DIM*IMG_DIM*IMG_DIM])
    image  = tf.reshape(image, [IMG_DIM,IMG_DIM,IMG_DIM,1])

    labels.set_shape([IMG_DIM*IMG_DIM*IMG_DIM])
    labels  = tf.reshape(image, [IMG_DIM,IMG_DIM,IMG_DIM])

    # Dimensions (X, Y, Z, channles)
    return image, labels
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号