mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-30 03:37:44 +00:00
patched the logic of removing the ._*.onnx file, in case it comes in position other than the first in listdir (#484)
This commit is contained in:
parent
1f1dcc352f
commit
ee702bd288
1 changed files with 12 additions and 4 deletions
|
|
@ -237,12 +237,20 @@ namespace Microsoft.ML.OnnxRuntime.Tests
|
|||
try
|
||||
{
|
||||
var onnxModelNames = modelDir.GetFiles("*.onnx");
|
||||
if (onnxModelNames.Count() != 1)
|
||||
if (onnxModelNames.Length > 1)
|
||||
{
|
||||
// TODO remove file "._resnet34v2.onnx" from test set
|
||||
if (onnxModelNames[0].Name == "._resnet34v2.onnx")
|
||||
onnxModelNames[0] = onnxModelNames[1];
|
||||
else
|
||||
bool validModelFound = false;
|
||||
for (int i = 0; i < onnxModelNames.Length; i++)
|
||||
{
|
||||
if (onnxModelNames[i].Name != "._resnet34v2.onnx")
|
||||
{
|
||||
onnxModelNames[0] = onnxModelNames[i];
|
||||
validModelFound = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!validModelFound)
|
||||
{
|
||||
var modelNamesList = string.Join(",", onnxModelNames.Select(x => x.ToString()));
|
||||
throw new Exception($"Opset {opset}: Model {modelDir}. Can't determine model file name. Found these :{modelNamesList}");
|
||||
|
|
|
|||
Loading…
Reference in a new issue