John
John

Reputation: 1003

Tensorflow InvalidArgumentError Invalid JPEG data, size 4096, Not Jpeg file 0x00 0x05

I am using the Tensorflow Image-retraining Tutorial, managed to get the Flower_photos working, but when i put in my photos for a test train, it got the error Tensorflow InvalidArgumentError Invalid JPEG data, size 4096

I am wondering if its because of an image that too large? If there is a set-Max size for an image? Or if there is a fixed height/width?

Because i see that on the flower_photos example, the pictures in there has all different height and width, so i am assuming there is no fixed height/width required?

Because i made sure the images are jpeg, and i changed the retrain.py in the image_retraining folder to tf.image.decode_image....but no luck

Edit Now i see that Not a JPEG file: starts with 0x00 0x05 not sure what it means

Edit: I couldnt find any threads/info or anything to help but after 14 hours of systematic testing, i have just copied the data set from Tensorflow retraining tutorial the flower_photos exactly as it is(from a Mac to Window 10 and onto VBox Ubuntu), and that also ran into the same problem. Now i believe its the copy/transfering process causes a JPEG to corrupt.

Upvotes: 2

Views: 2829

Answers (1)

John
John

Reputation: 1003

After 18 hours of repeat testing and trying many things out. If a dataset is transfer via USB (in my case from a Mac to Window onto Vbox), it will corrupt the JPEG, even if it doesnt seem like its corrupted, the image can be viewed with no problem etc....but when the decoder tries to read it, it will start with 0x00 0x05.

Upvotes: 4

Related Questions