This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| projects:iotaiuto:mycroft [2021/11/12 13:00] – daniel | projects:iotaiuto:mycroft [2021/12/15 13:10] (current) – daniel | ||
|---|---|---|---|
| Line 153: | Line 153: | ||
| * Andare su https:// | * Andare su https:// | ||
| - | ==== Installazione DeepSpeech ==== | + | ==== Installazione DeepSpeech |
| DeepSpeech è il motore STT di Mozilla\\ | DeepSpeech è il motore STT di Mozilla\\ | ||
| + | Scaricare ed estrarre questo modello basato su DeepSpeech: | ||
| + | https:// | ||
| + | |||
| + | |||
| Dal terminale del raspberry: | Dal terminale del raspberry: | ||
| < | < | ||
| Line 164: | Line 168: | ||
| mkdir deepspeech | mkdir deepspeech | ||
| cd deepspeech | cd deepspeech | ||
| - | curl -LO https:// | + | |
| - | tar xvf transfer_model_tflite_it.tar.xz | + | # copiare in questa cartella il modello tflite e lo scorer scaricati |
| - | rm transfer_model_tflite_it.tar.xz | + | |
| git clone https:// | git clone https:// | ||
| Line 175: | Line 179: | ||
| </ | </ | ||
| - | Aggiungere a config.json: | + | Aggiungere a config.json: |
| < | < | ||
| ... | ... | ||
| " | " | ||
| - | " | + | " |
| - | " | + | " |
| }, | }, | ||
| ... | ... | ||
| Line 229: | Line 233: | ||
| **Work in progress** | **Work in progress** | ||
| + | |||
| + | ===== Addestramento manuale di una rete neurale ===== | ||
| + | |||
| + | **ATTENZIONE**\\ | ||
| + | Prosegui solo se non vuoi usare il modello già addestrato e vuoi addestrare manualmente una rete neurale DeepSpeech.\\ | ||
| + | |||
| + | Requisiti: PC Desktop con scheda grafica nvidia | ||
| + | Assicurarsi che il sistema operativo supporti CUDA 10.0.0. Non usare versioni più recenti di cuda. | ||
| + | (Testato con Ubuntu 18.04) | ||
| + | |||
| + | Verificare se i driver nvidia sono installati: | ||
| + | < | ||
| + | nvidia-smi | ||
| + | </ | ||
| + | Questo comando dovrebbe mostrare una tabella con alcune proprietà della gpu | ||
| + | |||
| + | Installare Cuda 10.0.0, potrebbe essere necessario disinstallare i driver nvidia e reinstallarli dopo cuda\\ | ||
| + | https:// | ||
| + | |||
| + | Installare docker e nvidia-docker: | ||
| + | https:// | ||
| + | https:// | ||
| + | Prima di proseguire è consigliato fare un test per assicurarsi che docker riesca a vedere la gpu | ||
| + | |||
| + | Scaricare il dataset più recente di CommonVoice\\ | ||
| + | https:// | ||
| + | |||
| + | Dovrebbe essere un file chiamato it.tar.gz\\ | ||
| + | Posizionate l' | ||
| + | < | ||
| + | cd $HOME | ||
| + | mkdir -p data/ | ||
| + | chmod a+rwx -R data | ||
| + | mv it.tar.gz data/ | ||
| + | chmod a+r data/ | ||
| + | </ | ||
| + | |||
| + | === Creare l' | ||
| + | |||
| + | Ho preso un tool di Mozilla-Italia che semplifica l' | ||
| + | < | ||
| + | cd $HOME | ||
| + | git clone https:// | ||
| + | cd DeepSpeech-Italian-Model/ | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | chmod +x generate_base_dockerfile.sh | ||
| + | ./ | ||
| + | |||
| + | docker build . -f Dockerfile.train -t deepspeech/ | ||
| + | docker build . -f Dockerfile_it.train -t deepspeech/ | ||
| + | </ | ||
| + | |||
| + | |||
| + | === Avviare l' | ||
| + | |||
| + | < | ||
| + | docker run -e " | ||
| + | </ | ||
| + | |||
| + | Se il processo occupa troppa memoria della gpu potrebbe essere necessario ridurre il BATCH_SIZE, esempio: | ||
| + | < | ||
| + | docker run -e " | ||
| + | </ | ||
| + | |||