【发布时间】:2021-07-28 02:26:40
【问题描述】:
我正在使用 tensorflow js 运行一个简单的基准测试应用程序。遇到这个非常奇怪的错误。
我创建了我的输入形状input_shape = model.inputs[0].shape
然后创建一个 zeros 数组作为模型var zeros = tf.zeros([input_shape]);的虚拟输入
然后调用await timeModelInference(model, zeros, 1) 会在标题中产生错误。
util_base.js:153 Uncaught (in promise) Error: The shape of dict['input'] provided in model.execute(dict) must be [-1,128,128,3], but was [-1,128,128,3]
at Vv (util_base.js:153)
at graph_executor.js:572
at Array.forEach (<anonymous>)
at e.t.checkInputShapeAndType (graph_executor.js:563)
at e.<anonymous> (graph_executor.js:345)
at c (runtime.js:63)
at Generator._invoke (runtime.js:293)
at Generator.next (runtime.js:118)
at bv (runtime.js:747)
at o (runtime.js:747)
我尝试将第一个维度更改为 [1,128,128,3] 或 [,128,128,3] 无济于事。
谢谢。
【问题讨论】: