0

I'm deploying a webapp on Google Cloud Plateform to test some trained models with Fast.ai. One of them is for sound recognition, and I need to use librosa to create a spectogram of the sound provided by the user. But librosa needs ffmpeg to work properly.

I added ffmpeg to my Dockerfile. It works fine when I deploy the application, but after few requests I get this error (as if ffmpeg is not installed) :

File "/usr/local/lib/python3.6/site-packages/audioread/init.py", line 116, in audio_open: raise NoBackendError() at load (/usr/local/lib/python3.6/site-packages/librosa/core/audio.py:119)

Sometimes, it works again. It looks like it depends on which instance the application is running on.

Here is my Dockefile :

FROM python:3.6-slim-stretch

RUN apt update
RUN apt install -y python3-dev gcc
RUN apt install -y ffmpeg

ADD requirements.txt requirements.txt
RUN pip install -r requirements.txt

COPY app app/

RUN python app/server.py

EXPOSE 8080

CMD ["python", "app/server.py", "serve"]```
Polegar
  • 11
  • 1

1 Answers1

1

Try adding the followig line to your Dockerfile:

RUN apt install -y libav-tools
marsipan
  • 343
  • 2
  • 11