dotnet / dotnet/machinelearning-samples

Dealing with Semantic Segmentation

Offen
#690 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
PowerShell
Sterne
4.7k
Forks
2.7k
Ø Merge
2 T. 22 Std.
Gemergte PRs (30 T.)
1

Beschreibung

**I loaded a "deeplabv3_mnv2_dm05_pascal_trainaug" model from TensorFlow Model Zoo, which is a .pb file. I've met these problems:**
**1. As far as I can see, the input image and the output image of deeplabv3 should both be an unknown-size image. Does ML.NET support unknow-size input and output? I tried but failed. So I have to add a "ResizeImages" before "ExtractPixels". Below is my pipeline code:**
`var pipeline =mlContext.Transforms.LoadImages(outputColumnName:"imageinput", ImagesFolderPath,nameof(ImageData.ImagePath))
.Append(mlContext.Transforms.ResizeImages(outputColumnName: "imageinput", inputColumnName: "imageinput",imageHeight:ImageProperty.ImageHeight,imageWidth:ImageProperty.ImageWidth))
.Append(mlContext.Transforms.ExtractPixels(outputColumnName: "ImageTensor", inputColumnName: "imageinput",outputAsFloatArray:false))
.Append(mlContext.Transforms.LoadImages(outputColumnName: "annotinput", ImagesFolderPath, nameof(ImageData.AnnotPath)))
.Append(mlContext.Transforms.ResizeImages(outputColumnName: "annotinput", inputColumnName: "annotinput", imageHeight:ImageProperty.ImageHeight,imageWidth:ImageProperty.ImageWidth))
.Append(mlContext.Transforms.ExtractPixels(outputColumnName: "SemanticPredictions", inputColumnName: "annotinput", outputAsFloatArray: false))
.Append(tensorFlowModel.ScoreTensorFlowModel( outputColumnNames:
new[] { "SemanticPredictions" },inputColumnNames: new[] { "ImageTensor" }, addBatchDimensionInput: true));`
2. **I got this error message while predicting:**
The first dimension of paddings must be the rank of inputs[3,2] [1,513,513,3] [[{{node Pad}}]]”

**And here is my prediction class:**
` class SemanticPredictions
{
[ColumnName(nameof(SemanticPredictions))]
[VectorType(513,513)]
public Int64[] Output { get; set; }
}`

I really need your help.
Best Regards!

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne damit, die gemeldete Pipeline mit dem Modell deeplabv3_mnv2_dm05_pascal_trainaug .pb zu reproduzieren, einschließlich der Schritte ResizeImages und ExtractPixels, und untersuche den Pad-Fehler während der Vorhersage. Vergleiche die Eingabe- und Ausgabedimensionen mit der VectorType(513,513)-Deklaration der Klasse SemanticPredictions. Als abgeschlossen gilt die Aufgabe, wenn die unterstützte Verarbeitung von Tensoren unbekannter Größe und die Ursache des gemeldeten Dimensionsfehlers dokumentiert oder korrigiert sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp, tensorflow
Bereich
machine-learning
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.