ValueError: Scorer initialization failed with error code 8198 swig/python detected a memory leak of type 'Alphabet *', no destructor found

As I said, it’s not yet ready, I’m facing the same issue but my time is limited, was busy with other stuff, now it’s weekend.

Maybe it’s caused by this manual virtual env activation? Try prepending the Python commands with a call to the activation script, like so:

RUN python3 -m venv venv/
RUN source venv/bin/activate && pip install --upgrade pip==20.0.2 wheel==0.34.2 setuptools==46.1.3
RUN source venv/bin/activate && pip install --upgrade --editable .
RUN source venv/bin/activate && python DeepSpeech.py ...

No problem. I just wanted to raise the issue now and see if it was a similar issue you were having. I’ll give Reuben’s suggestion a try in the meantime.

I don’t think source works well in Dockerfile. I think you have to use the dot operator like:

RUN python3 -m venv venv/
RUN . venv/bin/activate && pip install --upgrade pip==20.0.2 wheel==0.34.2 setuptools==46.1.3
RUN . venv/bin/activate && pip install --upgrade --editable .
RUN . venv/bin/activate && python DeepSpeech.py ...

I get “bin/sh/ source” not found errors every time I’ve tried using source to activate a venv in Docker. I’m sure there are other methods using SHELL but not sure…

So I had successful build and training by doing something like this. The next step would be to activate the venv in /DeepSpeech/venv/bin/activate and run the training .sh script for full automation but with this Dockerfile you’ll get all the desired venv scripts in your /DeepSpeech directory and training will be ready.

Thanks for your help @reuben and @lissyx . Appreciate it.

FROM tensorflow/tensorflow:1.15.2-py3

RUN apt-get update && apt-get install -y \
        apt-utils \
        vim \
        bash-completion \
        build-essential \
        curl \
        git \
        git-lfs \
        unzip \
        wget \
        python3-venv

# Change to Root and install git lfs alternative way
WORKDIR /
RUN git lfs install
RUN git clone  https://github.com/mozilla/DeepSpeech

#  Change to Deepspeech repo clone and setup venv and pip3 install all of the training code
WORKDIR /DeepSpeech
#RUN python3 -m venv venv/
#ENV VIRTUAL_ENV $(pwd)/venv
#ENV PATH $VIRTUAL_ENV/bin:$PATH
#RUN which python3
RUN python3 -m venv venv/
RUN . venv/bin/activate && pip install --upgrade pip==20.0.2 wheel==0.34.2 setuptools==46.1.3
RUN . venv/bin/activate && pip install --upgrade --editable .
RUN which python3

I am getting the similar scorer error and when running git lfs pull, I get the following error:

batch response: This repository is over its data quota. Account responsible for LFS bandwidth should purchase more data packs to restore access.
error: failed to fetch some objects from 'https://github.com/mozilla/DeepSpeech.git/info/lfs'

I am working with DeepSpeech-0.7.4 on Colab

We have disabled Git LFS, please stop using it.

1 Like

I have simply cloned the repo but it still gives
ValueError: Scorer initialization failed with error code 8198
Although the kenlm.scorer is present in the default directory, would be really thankful if you can help.

Sorry but you hijack old threads without sharing any informations. As I said, we stopped using Git LFS, please uninstall it, and download kenlm.scorer from 0.7.4 github release artifacts

I apologize, I am new here, saw the same issue and thought this was the right place to post. The issue has been resolved by manually downloading the scorer. thanks!

1 Like