gpt4 book ai didi

python - 使用 TFLite 转换 LSTM 图失败

转载 作者:太空宇宙 更新时间:2023-11-04 02:22:23 31 4
gpt4 key购买 nike

伙计们,每当我尝试将我的 LSTM 图转换为 TFLite 时,我都会遇到错误:

user@user:~/tensorflow/tensorflow$ bazel run --config=opt   //tensorflow/contrib/lite/toco:toco --   --input_file=/home/user/model/rnn/lstm_graph_mobilnet_v2_100_128.pb   --output_file=/home/user/model/rnn/lstm_graph_mobilnet_v2_100_128.tflite   --input_format=TENSORFLOW_GRAPHDEF   --output_format=TFLITE   --inference_type=FLOAT   --input_shape=1,10,2560   --input_array=input/x_input   --output_array=output/y_pred
WARNING: ignoring http_proxy in environment.
.......................
WARNING: /home/user/.cache/bazel/_bazel_user/9944cfee49d745019014aac0edc80315/external/protobuf_archive/WORKSPACE:1: Workspace name in /home/user/.cache/bazel/_bazel_user/9944cfee49d745019014aac0edc80315/external/protobuf_archive/WORKSPACE (@com_google_protobuf) does not match the name given in the repository's definition (@protobuf_archive); this will cause a build error in future versions
INFO: Analysed target //tensorflow/contrib/lite/toco:toco (84 packages loaded).
INFO: Found 1 target...
Target //tensorflow/contrib/lite/toco:toco up-to-date:
bazel-bin/tensorflow/contrib/lite/toco/toco
INFO: Elapsed time: 88.490s, Critical Path: 35.68s
INFO: Build completed successfully, 1 total action

INFO: Running command line: bazel-bin/tensorflow/contrib/lite/toco/toco '--input_file=/home/user/model/rnn/lstm_graph_mobilnet_v2_100_128.pb' '--output_file=/home/users/model/rnn/lstm_graph_mobilnet_v2_100_128.tflite' '--input_format=TENSORFLOW_GRAPHDEF' '--output_format=TFLITE' '--inference_type=FLOAT' '--input_shape=1,10,2560' '--input_array=input/x_input' '--output_array=output/y_pred'
2018-07-10 16:38:59.794308: F tensorflow/contrib/lite/toco/tooling_util.cc:822] Check failed: d >= 1 (0 vs. 1)

推理时,batch size = 1,10个输入,每个输入长度为2560

为什么我的 d 维度为 0 >=1(0 对 1)?

有没有将 RNN 转换为 TFLite 的示例项目?

最佳答案

这个方法对我有用: LSTM pb to tflite

关于python - 使用 TFLite 转换 LSTM 图失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51275360/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com