Skip to content

Commit b468adb

Browse files
committed
Fixed a bug in the unit test for image classification
1 parent 30aa4d1 commit b468adb

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Microsoft.ML.Dnn/ImageClassificationTransform.cs

+1
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ private static Tensor EncodeByteAsString(VBuffer<byte> buffer)
204204
fixed (byte* src = buffer.GetValues())
205205
c_api.TF_StringEncode(src, (UIntPtr)length, (sbyte*)(tensor + sizeof(Int64)), size, status);
206206
}
207+
207208
status.Check(true);
208209
status.Dispose();
209210
return new Tensor(handle);

test/Microsoft.ML.Tests/ScenariosWithDirectInstantiation/TensorflowTests.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1242,11 +1242,11 @@ public void TensorFlowImageClassification()
12421242
IDataView trainDataset = trainTestData.TrainSet;
12431243
IDataView testDataset = trainTestData.TestSet;
12441244

1245-
var validationSet = mlContext.Transforms.LoadImages("Image", fullImagesetFolderPath, true, "ImagePath") // true indicates we want the image as a VBuffer<byte>
1245+
var validationSet = mlContext.Transforms.LoadImages("Image", fullImagesetFolderPath, false, "ImagePath") // false indicates we want the image as a VBuffer<byte>
12461246
.Fit(testDataset)
12471247
.Transform(testDataset);
12481248

1249-
var pipeline = mlContext.Transforms.LoadImages("Image", fullImagesetFolderPath, true, "ImagePath") // true indicates we want the image as a VBuffer<byte>
1249+
var pipeline = mlContext.Transforms.LoadImages("Image", fullImagesetFolderPath, false, "ImagePath") // false indicates we want the image as a VBuffer<byte>
12501250
.Append(mlContext.Model.ImageClassification(
12511251
"Image", "Label",
12521252
// Just by changing/selecting InceptionV3 here instead of

0 commit comments

Comments
 (0)