-
Notifications
You must be signed in to change notification settings - Fork 45.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using eval() for Decode JPEG #564
Comments
@danleh93 : It is possible that the image is not valid (at 52-bytes, it seems really small :) Does the image load up correctly in an image viewer? You can also try the Let us know what you find. |
@asimshankar : Thanks for the response. I did some further investigation: The image does, in fact, load up correctly in an image viewer. Furthermore, when running
I am not sure why Tensorflow is only reading it as 52-bytes. When I do a |
Oh, wait, sorry, I missed something. So the 52-bytes is the filename. contents = ''
with open('path/to/image.jpeg') as f:
contents = f.read()
tf.image.decode_jpeg(contents) Hope that helps. |
That worked! Can't believe I forgot about that part. Thanks so much! |
Hi~, I meet a problem about convert_image_dtype. with open('/home/give/Documents/dataset/ADEChallengeData2016/images/validation/ADE_val_00000001.jpg') as f:
content = f.read()
image = tf.image.decode_jpeg(content, channels=3)
image_float = tf.image.convert_image_dtype(image, dtype=tf.float32)
img, img_float = sess.run([image, image_float])
# print img
# print img_float
print np.max(img_float), np.min(img_float) when i execute this code, why np.max(img_float), np.min(img_float) both are nan? The value of img is normal. Do you know the reason? Thanks |
@danleh93 , I meet a silimar question with you when i train models on google TensorFlow Object Detection API, May i ask if the question has been solved? what's the problem and how to solved? thank you! |
tensorflow/models/slim/preprocessing/inception_preprocessing
I modified the
preprocess_for_eval(...)
function to look like:The code executes perfectly, however, when I do something like
image_tensor = preprocess_for_eval("path/to/image.jpeg",300,300).eval(session=sess)
I get an error stating:
I know for a fact that my image is a JPEG because when I do:
file image.jpeg
on the command line I get:JPEG image data, JFIF standard 1.01, resolution (DPI), density 72x72, segment length 16, baseline, precision 8, 300x300, frames 3
Even when I try
tf.image.decode_png
I get an invalid PNG header message.The text was updated successfully, but these errors were encountered: