MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / main

Function main

tensorflow/lite/tutorials/mnist_tflite.py:71–82  ·  view source on GitHub ↗
(_)

Source from the content-addressed store, hash-verified

69
70
71def main(_):
72 interpreter = tf.lite.Interpreter(model_path=flags.model_file)
73 interpreter.allocate_tensors()
74 num_correct, total = 0, 0
75 for input_data in test_image_generator():
76 output = run_eval(interpreter, input_data[0])
77 total += 1
78 if output == input_data[1]:
79 num_correct += 1
80 if total % 500 == 0:
81 print('Accuracy after %i images: %f' %
82 (total, float(num_correct) / float(total)))
83
84
85if __name__ == '__main__':

Callers

nothing calls this directly

Calls 4

allocate_tensorsMethod · 0.95
test_image_generatorFunction · 0.85
run_evalFunction · 0.85
InterpreterMethod · 0.45

Tested by

no test coverage detected