-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DeepSpeech exporting INT64 instead of expected INT32 into SparseToDence opp, not friendly to mobile TensorFlow. #1309
Comments
Thanks. To my knowledge, iOS, Android (and RPi3) builds are defining
So i'm curious to know more about your build steps. |
See also #1095 |
I am running my own training of Deepspeech on the side, I got to pretty high accuracy on desktop. |
@evangel76 Right, thanks. Then I would suggest you try to work on the streaming branch https://github.com/mozilla/DeepSpeech/tree/streaming-inference that @reuben is going to land, because you are loosing your time with that right now :-). Doing that kind of hack on the current model is a dead-end, and if we need this kind of changes, then we would rather do it on the streaming model and it might be of interest to @reuben if you can experiment on iOS, because none of us has time for that right now :). FYI, with the streaming model, you can see also #1224, I've run some experiments with I'm going to close this, but really, thanks for hacking on iOS, we are interested in that :) |
@evangel76 Also, you might want to come and discuss with us on IRC (#machinelearning on irc.mozilla.org) and / or on Discourse: https://discourse.mozilla.org/c/deep-speech, I'd hate that you burn your time for nothing: contributor's time has too much value to me, especially when you are hacking stuff that are that useful ! So again, really, thanks for your feedback and issue :-) |
That is an odd reply ... I got the all thing working pretty accurately on iOS, saying it is a dead-end is strange at best, but well, since we are sharing opinions, here is mine: |
@evangel76 I never said it was not good, I said that the code you need to change is going away: Lines 1720 to 1763 in 1926bce
sparse_to_dense anymore. It's not just about memory footprint, it's about complexity of the network.
So, if you use that branch for your work, it should even be easier. |
Fair, thanks |
@evangel76 Just to give more context: changing this datatype might have impact on the recognition rate itself (or it might not): this is something that would require precise investigation to ensure we are not breaking anything. Now, we still have several pending benchmarks before we can release v0.2.0, a version where we do not want to change the model. Then, streaming will arrive in v0.3.0. Still, we are very interested in any result you get :) |
I started to replace the code with the streaming version , and replugging Metal acceleration into it for iOS. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
tf.sparse_to_dense should be casted to be only INT32 parameters instead of INT64 default
DeepSpeech/DeepSpeech.py
Line 1697 in d68fde8
I used Tensorflow 1.6 on Ubuntu 16.04
The lack of casting makes the model import crash on iOS and android, and requires to post processing to be mobile friendly.
[tf.sparse_tensor_to_dense(sparse_tensor) for sparse_tensor in decoded], name='output_node')
should be something like this:
[tf.sparse_tensor_to_dense(tf.to_int32(sparse_tensor)) for sparse_tensor in decoded], name='output_node')
There are probably better solution that a brutal C like casting.
Because of it, the Import of the model under iOS gives:
No OpKernel was registered to support Op 'SparseToDense' with these attrs. Registered devices: [CPU], Registered kernels:
device='CPU'; T in [DT_INT32]; Tindices in [DT_INT32]
device='CPU'; T in [DT_INT32]; Tindices in [DT_INT64]
device='CPU'; T in [DT_FLOAT]; Tindices in [DT_INT32]
device='CPU'; T in [DT_FLOAT]; Tindices in [DT_INT64]
device='CPU'; T in [DT_BOOL]; Tindices in [DT_INT32]
device='CPU'; T in [DT_BOOL]; Tindices in [DT_INT64]
device='CPU'; T in [DT_STRING]; Tindices in [DT_INT32]
device='CPU'; T in [DT_STRING]; Tindices in [DT_INT64]
The text was updated successfully, but these errors were encountered: