From b0feaef9de0eeab34480bec00f83b90fb3e0b5e1 Mon Sep 17 00:00:00 2001
From: shahasad <43590019+shahasad@users.noreply.github.com>
Date: Mon, 7 Oct 2019 19:14:34 -0700
Subject: [PATCH] Update the C# pretrained model test to include opset9 and 10
models (#2003)
---
csharp/OnnxRuntime.CSharp.proj | 2 +-
.../InferenceTest.cs | 424 ++++++++++++++----
2 files changed, 338 insertions(+), 88 deletions(-)
diff --git a/csharp/OnnxRuntime.CSharp.proj b/csharp/OnnxRuntime.CSharp.proj
index 9651738fa3..64cc865f09 100644
--- a/csharp/OnnxRuntime.CSharp.proj
+++ b/csharp/OnnxRuntime.CSharp.proj
@@ -56,7 +56,7 @@ CMake creates a target to this project
-
+
diff --git a/csharp/test/Microsoft.ML.OnnxRuntime.Tests/InferenceTest.cs b/csharp/test/Microsoft.ML.OnnxRuntime.Tests/InferenceTest.cs
index 6e2b5417ca..47c756c2d7 100644
--- a/csharp/test/Microsoft.ML.OnnxRuntime.Tests/InferenceTest.cs
+++ b/csharp/test/Microsoft.ML.OnnxRuntime.Tests/InferenceTest.cs
@@ -9,6 +9,7 @@ using System.Runtime.InteropServices;
using Microsoft.ML.OnnxRuntime.Tensors;
using System.Threading.Tasks;
using Xunit;
+using Xunit.Abstractions;
namespace Microsoft.ML.OnnxRuntime.Tests
{
@@ -16,6 +17,12 @@ namespace Microsoft.ML.OnnxRuntime.Tests
{
private const string module = "onnxruntime.dll";
private const string propertiesFile = "Properties.txt";
+ private readonly ITestOutputHelper output;
+
+ public InferenceTest(ITestOutputHelper o)
+ {
+ this.output = o;
+ }
[Fact]
public void TestSessionOptions()
@@ -309,94 +316,211 @@ namespace Microsoft.ML.OnnxRuntime.Tests
session.Dispose();
}
- [x64Fact]
- private void TestPreTrainedModelsOpset7And8()
+ private static Dictionary GetSkippedModels()
{
- var skipModels = new List() {
- "mxnet_arcface", // Model not supported by CPU execution provider
- "tf_inception_v2", // TODO: Debug failing model, skipping for now
- "fp16_inception_v1", // 16-bit float not supported type in C#.
- "fp16_shufflenet", // 16-bit float not supported type in C#.
- "fp16_tiny_yolov2" }; // 16-bit float not supported type in C#.
+ var skipModels = new Dictionary() {
+ { "mxnet_arcface", "Model not supported by CPU execution provider" } ,
+ { "tf_inception_v2", "TODO: Debug failing model, skipping for now" },
+ { "fp16_inception_v1", "16-bit float not supported type in C#." },
+ { "fp16_shufflenet", "16-bit float not supported type in C#." },
+ { "fp16_tiny_yolov2", "16-bit float not supported type in C#." },
+ { "BERT_Squad", "Could not find an implementation for the node bert / embeddings / one_hot:OneHot(9)" },
+ { "mlperf_ssd_mobilenet_300", "Could not find file output_0.pb" }
+ };
+ // The following models fails on nocontribops win CI
var disableContribOpsEnvVar = Environment.GetEnvironmentVariable("DisableContribOps");
var isContribOpsDisabled = (disableContribOpsEnvVar != null) ? disableContribOpsEnvVar.Equals("ON") : false;
if (isContribOpsDisabled)
{
- skipModels.Add("test_tiny_yolov2");
+ skipModels["test_tiny_yolov2"] = "Fails when ContribOps is disabled";
+ skipModels["mask_rcnn_keras"] = "Pad is not a registered function/op";
}
- var opsets = new[] { "opset7", "opset8" };
- var modelsDir = GetTestModelsDir();
- foreach (var opset in opsets)
+ // This model fails on x86 Win CI
+ if (System.Environment.Is64BitProcess == false)
{
- var modelRoot = new DirectoryInfo(Path.Combine(modelsDir, opset));
- foreach (var modelDir in modelRoot.EnumerateDirectories())
+ skipModels["test_vgg19"] = "Get preallocated buffer for initializer conv4_4_b_0 failed";
+ }
+
+ return skipModels;
+ }
+
+ public static IEnumerable