File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 7
7
# default input shape 224x224x3
8
8
model = tf .keras .applications .MobileNetV3Large ()
9
9
10
- x = tf .TensorSpec (model .input_shape , tf .float32 )
10
+ x = tf .TensorSpec (model .input_shape , tf .float32 , name = "x" )
11
11
concrete_function = tf .function (lambda x : model (x )).get_concrete_function (x )
12
12
# now all variables are converted to constants.
13
13
# if this step is omitted, dumped graph does not include trained weights
23
23
24
24
frozen_model_pred = frozen_model (tf .cast (sample , tf .float32 ))[0 ]
25
25
assert_almost_equal (original_pred .numpy (), frozen_model_pred .numpy ())
26
- decoded = tf .keras .applications .mobilenet_v3 .decode_predictions (original_pred .numpy ())[0 ]
26
+ decoded = tf .keras .applications .mobilenet_v3 .decode_predictions (original_pred .numpy ())[
27
+ 0
28
+ ]
27
29
print (decoded )
28
-
You can’t perform that action at this time.
0 commit comments