lixiangchun commited on
Commit
fa86dca
1 Parent(s): b97b929

add README

Browse files
Files changed (1) hide show
  1. README.md +19 -0
README.md ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ```
2
+ const tf = require('@tensorflow/tfjs');
3
+ const tfnode = require('@tensorflow/tfjs-node');
4
+
5
+ async function loadModel(){
6
+ const handler = tfnode.io.fileSystem('tfjs_imagenet_resnet18_saved_model/model.json');
7
+ const model = await tf.loadGraphModel(handler);
8
+ console.log("Model loaded")
9
+
10
+ const zeros = tf.randomNormal([8, 3, 224, 224]);
11
+ const out = model.predict(zeros);
12
+ console.log(out);
13
+ out.print();
14
+ }
15
+
16
+ loadModel();
17
+
18
+ ```
19
+