-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Evaluating model that loads images from disk throws an exception in ASP.NET core #5113
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
System.Drawing is not a part of .net core, because it has a dependency to win-system32. |
Hi, @adriansd27 . Has following @ddobric 's suggestion helped you to fix this issue? If not, can you please share a .zip containing your project and some sample data so that I can try to reproduce your problem? I'll need to know what your pipeline looks like, and how you're loading the images, so having a full repro would be very helpful. It would also help if you try to run your same code not in an ASP.Net Core app but actually on a Console App, and let us know the results. I believe that if you're able to use I also wonder if this is related to #4126 . I've recently fixed that issue, but my fix will be available only on the next release. There, the user was also getting a similar stack trace to the one you're getting here... but there, the user was using in-memory images (i.e. they weren't using Another recommendation is to check if all your image files are in good state, have you actually tried to run PredictionEnginePool over all of them? perhaps there's some problem with only particular files or some particular filenames. |
Hey @antoniovs1029 , Unfortunately I'm not able to share the solution zip. I can assure you that all the images are in good state, I've tried this with different datasets. Cheers, |
I see. @adriansd27 could you please share a simplified solution where your error is reproduced using some mock image dataset? Or at least share what your pipeline looks like, as well as to how are you creating the testImageDataTags enumerable. I'd imagine there's some problem in here. Also I'd like to know if your pipeline ends with a tensorflow estimator, or not? Have you tried also changing your pipeline to see if it works with another kind of pipeline? Thanks. |
I've made my own metrics implementation, so I'm not able to test this anymore. I've also switched to in memory loading of images. However, at some point, I've encountered this problem again when evaluating the model with my own metrics methods, at this line of code:
I've applied your fix for yielding list over the parameter of that method and the exception started to occur in the yield list function. I've been able to fix it by using pure functions for every method that used bitmap. Since ASP.NET Core apps are parallel, using impure functions with bitmap type may cause errors. So the root of the cause might be using impure functions with bitmap images while running in an asynchronous app. |
Close this issue as seems we are lack of information to repro this issue so no further action from our end. Feel free to reopen if necessary, thanks. |
System information
Issue
I'm running ASP.NET Core 3.1. Training the model works fine. PredictionEnginePool predicts fine. However if I try to get the metrics of the trained model I'm getting the below exception. Is it that ASP.NET Core doesn't support System.Drawing.Bitmap? If so, is there any alternative option to evaluate a model in ASP.NET Core?
Source code / logs
The text was updated successfully, but these errors were encountered: