Repository navigation
Closed
Milestone
Description
System Information (please complete the following information):
- OS & Version: Windows 10
- ML.NET Version: ML.NET v4.0.2
- .NET Version: .NET 8.0
Describe the bug
In https://github.com/dotnet/machinelearning-samples, open ObjectDetection project, explicitly depend on SkiaSharp package 3.116.1, run, and observe failure:
=====Identify the objects in the images=====
System.InvalidOperationException: Splitter/consolidator worker encountered exception while consuming source data
---> System.MissingMethodException: Method not found: 'System.ReadOnlySpan`1<Byte> SkiaSharp.SKBitmap.GetPixelSpan()'.
at Microsoft.ML.Data.MLImage.get_Pixels()
at Microsoft.ML.Transforms.Image.ImagePixelExtractingTransformer.Mapper.<>c__DisplayClass5_0`1.<GetGetterCore>b__1(VBuffer`1& dst)
at Microsoft.ML.Transforms.Onnx.OnnxTransformer.Mapper.NamedOnnxValueGetterVec`1.GetNamedOnnxValueCore()
at Microsoft.ML.Transforms.Onnx.OnnxTransformer.Mapper.NamedOnnxValueGetterVec`1.GetNamedOnnxValueKnownSize()
at Microsoft.ML.Transforms.Onnx.OnnxTransformer.Mapper.NamedOnnxValueGetterVec`1.GetNamedOnnxValue()
at Microsoft.ML.Transforms.Onnx.OnnxTransformer.Mapper.UpdateCacheIfNeeded(Int64 position, INamedOnnxValueGetter[] srcNamedOnnxValueGetters, List`1 activeOutputColNames, OnnxRuntimeOutputCacher outputCache)
at Microsoft.ML.Transforms.Onnx.OnnxTransformer.Mapper.<>c__DisplayClass14_0`1.<MakeTensorGetter>b__0(VBuffer`1& dst)
at Microsoft.ML.Data.DataViewUtils.Splitter.InPipe.Impl`1.Fill()
at Microsoft.ML.Data.DataViewUtils.Splitter.<>c__DisplayClass7_1.<ConsolidateCore>b__2()
--- End of inner exception stack trace ---
at Microsoft.ML.Data.DataViewUtils.Splitter.Batch.SetAll(OutPipe[] pipes)
at Microsoft.ML.Data.DataViewUtils.Splitter.Cursor.MoveNextCore()
at Microsoft.ML.Data.RootCursorBase.MoveNext()
at Microsoft.ML.Data.ColumnCursorExtensions.GetColumnArrayDirect[T](IDataView data, Int32 col)+MoveNext()
at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.TryGetElement[TSource](IEnumerable`1 source, Int32 index, TSource& element)
at System.Linq.Enumerable.ElementAt[TSource](IEnumerable`1 source, Int32 index)
at ObjectDection.Program.Main(String[] args) in C:\Projects\Intermediate\machinelearning-samples\samples\csharp\getting-started\DeepLearning_ObjectDetection_Onnx\ObjectDetectionConsoleApp\Program.cs:line 43
========= End of Process..Hit any Key ========
Root cause is ImageAnalytics.
To Reproduce
Steps to reproduce the behavior:
- Download and use https://github.com/dotnet/machinelearning-samples
- Open
samples\csharp\getting-started\DeepLearning_ObjectDetection_Onnx\ObjectDetectionConsoleApp.ObjectDetection.csproj - Use NuGet to explicitly install
SkiaSharpversion 3.116.1 - Run
- Fail
Expected behavior
Shouldn't fail or are there alternatively/ways to configure?
Also the package dependency of ML.Net.ImageAnalytics claims SkiaSharp >2.88
Screenshots, Code, Sample Projects
See log error above.
Additional context
I am using ML.Net in a project that already depends on SkiaSharp explicitly.
Reacted by Bohdan Dnistrian, radwa-assai, Eddie Hartman and Copilot
Metadata
Metadata
Assignees
Labels
No labels
Activity
nzcoward commentedon Mar 8, 2025
The method was tagged as a breaking change (method removed) in 3.0:
https://github.com/mono/SkiaSharp/blob/3dcd422df6afe0790f2dc7911a86f5107a6a5fbd/changelogs/SkiaSharp/3.0.0/SkiaSharp.breaking.md?plain=1#L96
Rather the ReadOnlySpan was replaced by Span in this commit:
mono/SkiaSharp@a140a20#diff-2fe5c8811697b2372f41ceac4dec6242de61cddbc98e636348fdab5b3b0ee175L369
And remains in the current main:
https://github.com/mono/SkiaSharp/blob/cf545baf112b0eecb3ea4e3b9dda38e664f63054/binding/SkiaSharp/SKBitmap.cs#L300
[-]ObjectDetection demo fails with SkiaSharp 3.116.1[/-][+]Update to latest version of SkiaSharp[/+]michaelgsharp commentedon Mar 10, 2025
So essentially we need to get the version of SkiaSharp updated.
Sicos1977 commentedon Jul 25, 2025
Any updates on this?
Eddie-Hartman commentedon Feb 18, 2026
@stephentoub Reaching out to you since this seems to have slipped through the cracks and I can't really tell who is the primary maintainer of this repo anymore. This issue is still a problem and has been around for quite a while. As more projects try to upgrade (which is what just happened to me today), this will become a more prevalent issue. Can we get this addressed?