-
Notifications
You must be signed in to change notification settings - Fork 1.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
Error when train on customized dataset: Invalid JPEG data or crop window, data size 36864 #455
Comments
Is there any data corruption? it turns out to be very common like: tensorflow/tensorflow#7434 In this case, the error happens in input pipeline. It is necessary to debug on cpu and validate if data can be accessed correctly. I would recommend to write a simple program to test data pipeline. Here is an example to read data in eager mode: https://github.com/tensorflow/tpu/blob/master/models/official/mnasnet/post_quantization.py#L49 |
Thanks for your reply. Yeah, it is due to file transfer issue, I generated the tf records on another remote machine. I later met the corrupted tf record files error similar to corrupted record at 12, fixed by increasing the number of shards. |
InvalidArgumentError: Invalid JPEG data or crop window, data size 114304 [[{{node DecodeJpeg}}]] I am getting this error when i am running the below code
The log when i met the error: 11 frames During handling of the above exception, another exception occurred: InvalidArgumentError Traceback (most recent call last) InvalidArgumentError: Invalid JPEG data or crop window, data size 114304 Could please help how to resolve this same question is asked in stack overflow but no clear answer on internet please answer ASAP |
I faced similar problem. there is a problem in some of your training data. you can use code below to check which jpeg image is corrupted and delete it.
I used yasoob script to decode jpeg image. |
Thank you @milad-4274 (and yasoob) for sharing this jpeg checking script. It saved the day for us! For others who may be looking at this, I made a few small revisions to your script to get it working for us, the most important of which was replacing: if len(data)==0:
break with: if len(data)==0:
raise TypeError("issue reading jpeg file") The other small changes were importing tqdm: for dirName, subdirList, fileList in os.walk(img_dir):
imagesList = fileList
for img in tqdm(imagesList): Thanks again 👍 UPDATE: |
And how can I start this script? |
@OnSebii You need to define the path to the directory where your images are stored |
I do everything but it won't recognize the root_img. It raises an error that reads as follows: What should I replace it with? Thank you! |
I am having the same issue with root_img too. Were you able to resolve it? I am pretty new to all of this |
img_dir = ( 'same path ' ) |
Here the complete code with modifications that does the job for me
|
It seems to be
Invalid JPEG data or crop window
error, but I double-check the image format in my tf records are jpegs, I am wondering any possible reason that could cause this error?The code I check the image format in tf records:
The log when I met the error:
The text was updated successfully, but these errors were encountered: