-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Image Classification API] TensorFlow exception triggered: input ended unexpectedly in the middle of a field #4234
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
Comments
Using this pipeline worked. var trainingPipeline =
mapLabelTransform
.Append(mlContext.Model.ImageClassification(
"ImagePath",
"LabelAsKey",
arch: ImageClassificationEstimator.Architecture.ResnetV2101,
epoch: 100,
batchSize: 30,
metricsCallback: (metrics) => Console.WriteLine(metrics))); Switching back to the original code with 150 batch size or another value for that parameter worked as well. |
@luisquintanilla - So what exactly was causing the issue then? |
Any idea as to why that message is being thrown. I tried the same pipeline as you have in your comment but I am still getting that error message. |
@CESARDELATORRE not sure what happened as I was not able to replicate in this instance. I have experienced the issue in other runs but there's nothing I can potentially attribute this to. Re-running the application seems to "fix" it but it's not clear what causes it in the first place so it's difficult to replicate. |
It might make sense to hold off a bit on this issue and try the new preview API we're releasing in a few days for Image Classification since it's been evolving significantly. |
@luisquintanilla are you trying to run this in parallel with another instance of this code? Can you please provide a link to your repo with the complete sample so that we can repro it the same as you? Also what version of the nuget you are using? @ashbhandare is working on this. |
I think I found a way to reproduce. May be related to what @codemzs mentioned of running multiple instances (although not deliberately). If I run my application and stop it once it initializes, I run into this issue for subsequent runs. Deleting the |
I have isolated the source of this error. When you run the ImageClassification pipeline for the first time, the meta graph of the model (ResnetV2101 or InceptionV3) is downloaded, and in the subsequent runs, it is reused. If the run is interrupted while the download is in progress(by stopping), the protobuff is partially downloaded. This throws an error when this incomplete graph is attempted to be read in the subsequent runs. A temporary workaround is to delete the protobuff file and rerun. I'm working on a fix. |
* Add MaybeDownloadFile(), where check to redownload existing file if file is not of expected size. * Changed WebClient to HttpClient, renamed function to DownloadIfNeeded. * Added unit test. * Fixed newline after test * Removed asynchronous copy * added test for InceptionV3, fixed formatting. * Modify to call DownloadIfNeeded * fixed unit test, minor formatting * fix test and change after rebase * sync to master and use LoadRawImagesBytes instead of LoadImages. * Dispose HttpClient object and wait for task for finish. * clean up. * Use resource manager to download meta files. * remove test. * remove unused namespaces.
…t#4314) * Add MaybeDownloadFile(), where check to redownload existing file if file is not of expected size. * Changed WebClient to HttpClient, renamed function to DownloadIfNeeded. * Added unit test. * Fixed newline after test * Removed asynchronous copy * added test for InceptionV3, fixed formatting. * Modify to call DownloadIfNeeded * fixed unit test, minor formatting * fix test and change after rebase * sync to master and use LoadRawImagesBytes instead of LoadImages. * Dispose HttpClient object and wait for task for finish. * clean up. * Use resource manager to download meta files. * remove test. * remove unused namespaces.
…t#4314) * Add MaybeDownloadFile(), where check to redownload existing file if file is not of expected size. * Changed WebClient to HttpClient, renamed function to DownloadIfNeeded. * Added unit test. * Fixed newline after test * Removed asynchronous copy * added test for InceptionV3, fixed formatting. * Modify to call DownloadIfNeeded * fixed unit test, minor formatting * fix test and change after rebase * sync to master and use LoadRawImagesBytes instead of LoadImages. * Dispose HttpClient object and wait for task for finish. * clean up. * Use resource manager to download meta files. * remove test. * remove unused namespaces.
System information
Issue
Tried to train an image classification DNN model using the Image Classification API on the Intel Image Classification dataset.
The following exception was raised
The model to train.
Source code / logs
Source Code
Logs
Additional output to the console:
The text was updated successfully, but these errors were encountered: