tensorflow error:Unimplemented: Cast string to uint8 is not supported -


sorry poor english.first. i'm reading mnist tutorials,and try code functions encode images tfrecord , read data tfrecord files. , there errors. tf version 0.11 enter image description here i'm not sure whether there wrong in encoding or decoding process. compared codes tutorials code, no mistake can find. suspect no record read reader.read(), how can exam assumption?

img=image.open(img_path)  img=img.resize((rows,cols))  img_raw=img.tobytes()  example=tf.train.example(features=tf.train.features(feature={                  'image_raw':_byte_feature(img_raw),                  'label':_int64_feature(int(i))}))

decoding process

reader=tf.tfrecordreader()   _,example=reader.read(filequeue)  features=tf.parse_single_example(example,features={'image_raw':  tf.fixedlenfeature([],tf.string),  'label':tf.fixedlenfeature([],tf.int64)})  image=tf.decode_raw(features['image_raw'],tf.uint8)  image.set_shape(rows*cols)  image=tf.cast(image,tf.float32)*(1./255)-0.5  label=tf.cast(features['label'],tf.int32)
or mistake in somewhere else?


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -