TensorSpeech / TensorFlowASR

:zap: TensorFlowASR: Almost State-of-the-art Automatic Speech Recognition in Tensorflow 2. Supported languages that can use characters or subwords
https://huylenguyen.com/asr
Apache License 2.0
938 stars 245 forks source link

RNNT Loss from warp-transducer vs TF #232

Closed jun-danieloh closed 3 years ago

jun-danieloh commented 3 years ago

I see there are two RNNT Loss. One from warp-transducer and the other from TF. Which one do you recommend to use?

nglehuy commented 3 years ago

I personally recommended the one from TF because it doesn't need to install external libs, and it's implemented based on warp-transducer

jun-danieloh commented 3 years ago

@usimarit Perfect. Thanks :)

jun-danieloh commented 3 years ago

@usimarit

I am trying to install RNNT Loss from either TF or warp-transducer but both are not working.

1) RNNT Loss from TF I am referring to this repository for RNNT Loss from TF(https://github.com/iamjanvijay/rnnt), which is comparable with TF2.0 but not with TF 2.5.1 that I believe is the minimum TF version requirement at the moment. Do I miss anything?

2) RNNT Loss from warp-transducer I am trying to install the external library for RNNT Loss from warp-transducer. After successfully running cmake as in install_rnnt_loss.sh, it gives errors as below when I tried make. It looks like this rnnt loss is not compatible with CUDA 11.4 version that I am currently using.

root@elf-ml-v100:/home/azureuser/workspace/TensorFlowASR/externals/warp-transducer/build# make
[  7%] Building NVCC (Device) object CMakeFiles/warprnnt.dir/src/warprnnt_generated_rnnt_entrypoint.cu.o
nvcc fatal   : Unsupported gpu architecture 'compute_30'
CMake Error at warprnnt_generated_rnnt_entrypoint.cu.o.cmake:219 (message):
  Error generating
  /home/azureuser/workspace/TensorFlowASR/externals/warp-transducer/build/CMakeFiles/warprnnt.dir/src/./warprnnt_generated_rnnt_entrypoint.cu.o

CMakeFiles/warprnnt.dir/build.make:63: recipe for target 'CMakeFiles/warprnnt.dir/src/warprnnt_generated_rnnt_entrypoint.cu.o' failed
make[2]: *** [CMakeFiles/warprnnt.dir/src/warprnnt_generated_rnnt_entrypoint.cu.o] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/warprnnt.dir/all' failed
make[1]: *** [CMakeFiles/warprnnt.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

My Environment Information below:

Ubuntu 18.04
NVIDIA-SMI 470.57.02    Driver Version: 470.57.02    CUDA Version: 11.4 

Thanks, Daniel

nglehuy commented 3 years ago

@jun-danieloh The RNNT loss from TF you dont need to install anything except the tensorflow asr repo because we already integrated it. Only the warp-transducer needs to be installed externally. Since the warp-transducer has many problem about cuda version so I recommend to use the TF version of it. Just make sure you dont install the warp-transducer in order to use the TF version.

jun-danieloh commented 3 years ago

@usimarit

Okay. I miss understood. For using RNTT loss from TF, I don't need to do anything further except baseline code. That sounds perfect. Let me try now! Which one do you prefer between CTC loss vs RNNT Loss? I heard that RNNT is always hard to train.

nglehuy commented 3 years ago

@jun-danieloh I prefer rnnt loss since some sota papers use it. But you can try ctc loss but technically the author of rnnt loss gives some points that it's better than ctc loss. And yes it's harder to train since the rnnt is not officially supported in TF (unlike ctc loss - which is official) so the implementation might be incorrect or not optimized.

jun-danieloh commented 3 years ago

@usimarit

Thank you for your kind answers. One more question. You mentioned that I don't need to install anything to use rnnt loss from TF. You also mentioned that rnnt loss is not released officially from TF.

If TF is not released rnnt loss officially, how can I use it without installing it manually?

jun-danieloh commented 3 years ago

@usimarit I managed CTC parts :)