Dockerizing Nemo Model

Hi, we tried to setup a docker for NeMo b4 and not able to proceed since we got stuck at both the approaches we tried.

Approach 1:Docker build itself is failing

Approach 2: Docker build was successful but got audio signal error when running the transcribe operation

Environment used:

→ python 3.8.5

→ nemo-toolkit=1.0.0b3

→ additionally installed libsndfile1 ffmpeg and Cython

OS used:

→ Ubuntu 20.04 LTS AWS ec2 (p2x.large instance)

First Approach:

Dockerfile:

FROM nvcr.io/nvidia/nemo:1.0.0b3

RUN git clone -b v1.0.0b4 https://github.com/NVIDIA/NeMo.git

RUN pip3 install torchvision==0.9.0

RUN pip3 install -U torchtext==0.8.0

RUN pip3 install torch==1.7.1

RUN cd NeMo && bash reinstall.sh.

Build CMD: docker build -t test:1.0 .

Error Message:

Could not find a version that satisfies the requirement nvidia-eff>=0.2.6 (from nemo-toolkit==1.0.0b4) (from versions: 0.0.1.dev4)

ERROR: No matching distribution found for nvidia-eff>=0.2.6 (from nemo-toolkit==1.0.0b4)

The second approach is in the comments

Second Approach:

Dockerfile:

FROM nvcr.io/nvidia/nemo:1.0.0b3

RUN apt-get update -y

RUN apt-get install python3 python3-pip libsndfile1 ffmpeg -y

RUN pip3 install Cython

RUN pip3 install torchvision==0.9.0

RUN pip3 install -U torchtext==0.8.0

RUN pip3 install torch==1.7.1

RUN apt-get install nvidia-driver-460 -y

RUN git clone -b v1.0.0b4 https://github.com/NVIDIA/NeMo.git

RUN cd NeMo && bash reinstall.sh

Build CMD: docker build -t nemo:1.0 .

Dockerfile.model:

FROM nemo:1.0

WORKDIR /home/ubuntu

COPY ./hindi_model-20210318T104837Z-001/ /home/ubuntu/hindi_model-20210318T104837Z-001/

RUN pip3 uninstall torchaudio -y
RUN chmod +x /home/ubuntu/hindi_model-20210318T104837Z-001/hindi_model/inference_scripts/trial.py

RUN python3 /home/ubuntu/hindi_model-20210318T104837Z-001/hindi_model/inference_scripts/trial.py --license_key H201XMIHJFHQ89M --input /home/ubuntu/hindi_model-20210318T104837Z-001/hindi_model/data/new_1000/2710923c_29.wav --result /home/ubuntu/hindi_model-20210318T104837Z-001/hindi_model/data

Build CMD: docker build -f Dockerfile.model -t model:1.0 .

Error Message:

TypeError: NeuralTypeComparisonResult.SAME_TYPE_INCOMPATIBLE_PARAMS : Input type expected = axes: (batch, time); elements_type: AudioSignal | Input type found : axes: (batch, time); elements_type: AudioSignal

you don’t need to rebuilt the container, just follow these instructions:

Hi @Sunil-linuS, the approach you suggested was the first approach we tried and still got the error. We retried it again but still have the same error.

1 Like

@Sunil-linuS I have the exact issue -

  • Download - docker pull nvcr.io/nvidia/nemo:1.0.0b3
  • Git clone https://github.com/NVIDIA/NeMo.git
  • Checkout brach v1.0.0b4
  • cd nemo, bash reinstall.sh
    Got :
    ERROR: Could not find a version that satisfies the requirement nvidia-eff>=0.2.6 (from nemo-toolkit==1.0.0b4) (from versions: 0.0.1.dev4, 0.0.1.dev5)
    ERROR: No matching distribution found for nvidia-eff>=0.2.6 (from nemo-toolkit==1.0.0b4)

dependencies changes over time, you must look for updates nvidia-eff in pypi