【问题标题】:Tensorflow Lite tflite Process finished with exit code -1073741819Tensorflow Lite tflite 进程以退出代码 -1073741819 完成
【发布时间】:2019-06-29 16:33:31
【问题描述】:

发布一个我花了一段时间才弄清楚但在搜索时无法找到的问题,希望这可以帮助其他人节省一些时间。

当调用 set.tensor 程序崩溃并响应 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()

【问题讨论】:

    标签: python tensorflow-lite


    【解决方案1】:

    在调用 set_tensor 之前需要调用 allocate_tensor

    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()    
    

    【讨论】:

      猜你喜欢
      • 2018-11-10
      • 2020-06-13
      • 1970-01-01
      • 2023-04-06
      • 2019-01-05
      • 2020-03-19
      • 1970-01-01
      相关资源
      最近更新 更多