Przeglądaj źródła

Add TensorFlow Lite test file

Lutz Roeder 4 lat temu
rodzic
commit
7de01c0695
3 zmienionych plików z 16 dodań i 8 usunięć
  1. 1 4
      source/circle.js
  2. 1 4
      source/tflite.js
  3. 14 0
      test/models.json

+ 1 - 4
source/circle.js

@@ -489,10 +489,7 @@ circle.Parameter = class {
 circle.Argument = class {
 
     constructor(index, tensor, initializer) {
-        const name = tensor.name;
-        if (typeof name !== 'string') {
-            throw new circle.Error("Invalid argument identifier '" + JSON.stringify(name) + "'.");
-        }
+        const name = tensor.name || '';
         this._name = name + '\n' + index.toString();
         this._location = index.toString();
         this._type = tensor.type !== undefined && tensor.shape !== undefined ? new circle.TensorType(tensor) : null;

+ 1 - 4
source/tflite.js

@@ -502,10 +502,7 @@ tflite.Parameter = class {
 tflite.Argument = class {
 
     constructor(index, tensor, initializer) {
-        const name = tensor.name;
-        if (typeof name !== 'string') {
-            throw new tflite.Error("Invalid argument identifier '" + JSON.stringify(name) + "'.");
-        }
+        const name = tensor.name || '';
         this._name = name + '\n' + index.toString();
         this._location = index.toString();
         this._type = tensor.type !== undefined && tensor.shape !== undefined ? new tflite.TensorType(tensor) : null;

+ 14 - 0
test/models.json

@@ -5839,6 +5839,20 @@
     "format": "TensorFlow Lite v3",
     "link":   "https://www.tensorflow.org/lite/models"
   },
+  {
+    "type":   "tflite",
+    "target": "inception_v4_299_quant.tflite",
+    "source": "http://download.tensorflow.org/models/inception_v4_299_quant_20181026.tgz[inception_v4_299_quant.tflite]",
+    "format": "TensorFlow Lite v3",
+    "link":   "https://www.tensorflow.org/lite/models"
+  },
+  {
+    "type":   "tflite",
+    "target": "keyword_scrambled_8bit.tflite",
+    "source": "https://raw.githubusercontent.com/tensorflow/tflite-micro/master/tensorflow/lite/micro/models/keyword_scrambled_8bit.tflite",
+    "format": "TensorFlow Lite v3",
+    "link":   "https://github.com/tensorflow/tflite-micro"
+  },
   {
     "type":   "tflite",
     "target": "mobilenet_v1_0.75_160_quantized.tflite",