Geoff
Geoff

Reputation: 31

Tensorflow Lite tflite Process finished with exit code -1073741819

Posting a question that took me a while to figure out and was not able to find when searching, hopefully this helps someone else save sometime.

When calling set.tensor program crashes with a response Process finished with exit code -1073741819

interpreter = tf.lite.Interpreter(model_path="....")
input_details = interpreter.get_input_details()
output_details = interpreter.get_output_details()
interpreter.set_tensor(input_details[0]['index'],image_for_input )
interpreter.invoke()

Upvotes: 0

Views: 390

Answers (1)

Geoff
Geoff

Reputation: 31

Call to allocate_tensors is required before set_tensor can be called

interpreter = tf.lite.Interpreter(model_path="....")
input_details = interpreter.get_input_details()
output_details = interpreter.get_output_details()

interpreter.allocate_tensors()

interpreter.set_tensor(input_details[0]['index'],image_for_input )
interpreter.invoke()    

Upvotes: 1

Related Questions