TensorFlowASR: streaming_transducer can't convert h5 to tflite
Hi,
I try to convert transducer .h5 to tflite using tflite_streaming_transducer.py. But It’s not work…
First, I fix concrete_func = streaming_transducer.make_tflite_function().get_concrete_function()
(remove greedy=True argument of make_tflite_function() because error, tflite_streaming_transducer.py’s 60 line)
The below is the end of error result
%42:3 = "tf.If"(%41, %40, %arg4, %arg2, %24) {else_branch = @"streaming_transducer_greedy/while/cond_else", is_stateless = true, then_branch = @"streaming_transducer_greedy/while/cond_then"} : (tensor<i1>, tensor<i32>, tensor<2x2x1x1024xf32>) -> (tensor<i32>, tensor<i32>, tensor<2x2x1x1024xf32>)
%43 = "tfl.reshape"(%42#1, %cst_19) : (tensor<i32>, tensor<1xi32>) -> tensor<1xi32>
%44 = "tf.TensorScatterUpdate"(%arg3, %1, %43) {device = ""} : (tensor<?xi32>, tensor<1x1xi32>, tensor<1xi32>) -> tensor<?xi32>
%45 = "tfl.add"(%arg0, %cst_18) {fused_activation_function = "NONE"} : (tensor<i32>, tensor<i32>) -> tensor<i32>
"std.return"(%45, %2, %42#0, %44, %42#2, %arg5, %arg6) : (tensor<i32>, tensor<i32>, tensor<i32>, tensor<?xi32>, tensor<2x2x1x1024xf32>, tensor<i32>, tensor<?x320xf32>) -> ()
}) {sym_name = "streaming_transducer_greedy/while_body", sym_visibility = "private", type = (tensor<i32>, tensor<i32>, tensor<i32>, tensor<?xi32>, tensor<2x2x1x1024xf32>, tensor<i32>, tensor<?x320xf32>) -> (tensor<i32>, tensor<i32>, tensor<i32>, tensor<?xi32>, tensor<2x2x1x1024xf32>, tensor<i32>, tensor<?x320xf32>)} : () -> ()
I give timestamp argument such as make_tflite_function(timestamp=False). But It’s not work too
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 17
Hi, @usimarit Thank you for your reply always.
I encounter another issue about
tflite. Specifically, loadingtflitemodel problemh5model withtensorflow=2.3,TensorASR=0.6.3h5totfliteat the same env. So, usingtf-nightlyinstead oftensorflow=2.3. It works. I get thetflitemodelat
tf-nightly:at
tensorflow=2.3:@usimarit Hi, I convert that with
tf-nightly-cpuIt work, Thanks.@JeongWoonPark try using
tf-nightlyto convert to tflite.