wav2letter icon indicating copy to clipboard operation
wav2letter copied to clipboard

Stream convnet fork pretrained model was failed with "Unkown index in dictionary error"

Open phamvandan opened this issue 4 years ago • 8 comments
trafficstars

When i change the number of tokens classes from 854 to 470 it raised this error when fine tune with FORK Screenshot from 2020-12-26 11-44-41

and here is my config file

image

phamvandan avatar Dec 26 '20 04:12 phamvandan

Hi @phamvandan

Could you give details how you changes the tokens set and how the lexicon is created?

Also additional note: When you fork - you use the same network, which means the last layer will be the same as before which maps embedding into number of tokens. This menas that during fork you need to recreate last layer to have the necessary number of tokens.

tlikhomanenko avatar Jan 04 '21 04:01 tlikhomanenko

Hi @tlikhomanenko "This menas that during fork you need to recreate last layer to have the necessary number of tokens", How can i do this?

phamvandan avatar Jan 08 '21 14:01 phamvandan

Hi @tlikhomanenko, I created lexicon and token like this forms: image image And when i decrease the number of tokens from 870 to 470 i had errors above.

phamvandan avatar Jan 08 '21 14:01 phamvandan

One of the solutions https://github.com/facebookresearch/wav2letter/issues/829. Let me know if it is not clear. Here is also recent snapshot on doing similar thing https://github.com/facebookresearch/flashlight/blob/master/flashlight/app/asr/tutorial/FinetuneCTC.cpp#L254-L270 but you need to exclude last index from the loop on setting params.

tlikhomanenko avatar Jan 13 '21 08:01 tlikhomanenko

hi @tlikhomanenko , It means that we need to customize and rebuild?

phamvandan avatar Jan 14 '21 00:01 phamvandan

Yes. But this should be simple. Let me know if you need help in rebuild.

tlikhomanenko avatar Jan 17 '21 04:01 tlikhomanenko

Because I was not familiar with C++ language enough, so can you clear the method to rebuild for me? Thanks

phamvandan avatar Jan 18 '21 11:01 phamvandan

You need to follow installation either with docker image https://github.com/facebookresearch/flashlight/blob/master/.docker/Dockerfile-CUDA or from source https://github.com/facebookresearch/flashlight#building-from-source (you modify Train.cpp and then rerun make command).

tlikhomanenko avatar Jan 20 '21 02:01 tlikhomanenko