-
Notifications
You must be signed in to change notification settings - Fork 1.9k
ImageLoadingTransformer hides exceptions in Mapper.MakeGetter #3154
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
@eerhardt @danmosemsft Can you provide information regarding |
@safern @JeremyKuhne @nattress - do you have any recommendations here on using |
Not really, Drawing is just a platform not supported assembly in UWP, we basically just throw there. I don't know if there are any plans on supporting it in the near future (even if we can because of all the P/Invokes to GDI+). |
I was working with the exact same setup - Xamarin-based UWP utilising a previously trained TensorFlow model - and hit the PlatformNotSupportedException for System.Drawing when calling into the PredictionEngine:
It's my first time doing anything with ML.NET. Has there been any plan formulated to bring this sort of image support to ML.NET on UWP? |
Hi, @labChariot . As of now, ML.NET doesn't have any plan to provide image support on UWP. |
Thanks @antoniovs1029 |
ImageSharp just released RC2. I would love an implementation of the I started to take a look at implementing something locally, but access modifiers on the base classes make that difficult. I haven't had time to look it is beyond that. |
Is there any progress on migrating from System.Drawing to ImageSharp? |
Same issue here. Any update? |
There is a PR #6363 that should address this issue. |
System information
Issue
I recently tried to use ML.NET in a Xamarin-based UWP app. I targeted the earliest version of UWP that support .NET Standard 2.0 and everything installed correctly. My intention was to make use a separately-trained TensorFlow model to predict some data from an image.
While my code worked without issues in a .NET Core 2.2 console app, in the UWP it was failing. I was constantly getting an exception when attempting to load the target image -
Image [whatever] was not found.
No additional details, no inner exception.Only after a fair amount of headscratching and trying various things I managed to find the culprit (which was obvious in hindsight): UWP does not support bitmaps. After I tried to replicate a little bit of the
ImageLoader
code, I got an unsupported platform exception.This is all fair but then looking into the code some more, I found this:
machinelearning/src/Microsoft.ML.ImageAnalytics/ImageLoader.cs
Line 215 in b5a8d99
The code is catching all exceptions and throwing a custom exception in their place, without providing the base exception. I think this could be improved as part of making the API surface friendlier to use - spending an hour on this, I started to think I was doing something insanely wrong. The inner exception would have told me the root cause in 10 seconds flat.
So there are basically two issues:
I think a fix for 1. could be relatively simple. 2. will be much more difficult and might not be desirable but I wanted to throw it out there. Maybe using a platform-agnostic implementation of image handling could be useful.
Opinions? Thoughts?
The text was updated successfully, but these errors were encountered: