diff --git a/Dockerfile b/Dockerfile index f7ab37b2a71e..2101f2944817 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -ARG BASE_IMAGE=nvcr.io/nvidia/pytorch:20.07-py3 +ARG BASE_IMAGE=nvcr.io/nvidia/pytorch:20.08-py3 + # build an image that includes only the nemo dependencies, ensures that dependencies # are included first for optimal caching, and useful for building a development @@ -32,8 +33,8 @@ RUN apt-get update && \ # install nemo dependencies WORKDIR /tmp/nemo -COPY requirements/requirements_docker.txt requirements.txt -RUN pip install --disable-pip-version-check --no-cache-dir -r requirements.txt +COPY requirements . +RUN for f in requirements/*.txt; do pip install --disable-pip-version-check --no-cache-dir -r $f; done # copy nemo source into a scratch image FROM scratch as nemo-src diff --git a/nemo/core/classes/exportable.py b/nemo/core/classes/exportable.py index aed0071c92c8..77fb7fe150ae 100644 --- a/nemo/core/classes/exportable.py +++ b/nemo/core/classes/exportable.py @@ -51,6 +51,10 @@ def export( output: str, input_example=None, output_example=None, + verbose=False, + export_params=True, + do_constant_folding=True, + keep_initializers_as_inputs=False, onnx_opset_version: int = 12, try_script: bool = False, set_eval: bool = True, @@ -132,20 +136,22 @@ def export( _out_example = self.forward(*_in_example) else: _out_example = self.forward(_in_example) + torch.onnx.export( jitted_model, _in_example, output, input_names=input_names, output_names=output_names, - verbose=False, - export_params=True, - do_constant_folding=True, - keep_initializers_as_inputs=True, + verbose=verbose, + export_params=export_params, + do_constant_folding=do_constant_folding, + keep_initializers_as_inputs=keep_initializers_as_inputs, dynamic_axes=dynamic_axes, opset_version=onnx_opset_version, example_outputs=_out_example, ) + # Verify the model can be read, and is valid onnx_model = onnx.load(output) onnx.checker.check_model(onnx_model, full_check=True) diff --git a/reinstall.sh b/reinstall.sh index ff266836ecda..f5f9bbef09f8 100755 --- a/reinstall.sh +++ b/reinstall.sh @@ -1,16 +1,22 @@ #!/usr/bin/env bash set -e +PIP=pip + echo 'Uninstalling stuff' -pip uninstall -y nemo_toolkit +${PIP} uninstall -y nemo_toolkit # Kept for legacy purposes -pip uninstall -y nemo_asr -pip uninstall -y nemo_nlp -pip uninstall -y nemo_tts -pip uninstall -y nemo_simple_gan +${PIP} uninstall -y nemo_asr +${PIP} uninstall -y nemo_nlp +${PIP} uninstall -y nemo_tts +${PIP} uninstall -y nemo_simple_gan + +${PIP} install -U setuptools + +for f in requirements/*.txt; do ${PIP} install ${PIP_FLAGS}--disable-pip-version-check --no-cache-dir -r $f; done echo 'Installing stuff' -pip install -e ".[all]" +${PIP} install -e ".[all]" echo 'All done!' diff --git a/requirements/requirements_docker.txt b/requirements/requirements_docker.txt deleted file mode 100644 index c955f2af092e..000000000000 --- a/requirements/requirements_docker.txt +++ /dev/null @@ -1,66 +0,0 @@ -# core -numpy>=1.18.2 -onnx>=1.7.0 -pytorch-lightning>=0.8.5 -python-dateutil -torch -wget -wrapt -ruamel.yaml -scikit-learn -hydra-core==1.0.0rc2 - -# test -black -isort[requirements] < 5 -parameterized -pytest -pytest-runner -sphinx -sphinxcontrib-bibtex - - -# doc -latexcodec -sphinx_rtd_theme - - -# cv -pillow -torchvision - -# asr -braceexpand -editdistance -frozendict -inflect -kaldi-io -librosa -marshmallow -packaging -num2words -soundfile -sox -torch-stft -unidecode -webdataset -kaldi-python-io -scipy -pandas - -# nlp -boto3 -h5py -matplotlib -sentencepiece -torchtext -transformers>=2.11.0 -youtokentome -tqdm>=4.41.0 -rapidfuzz -gdown -megatron-lm>=1.1.3 - -# tts -pypinyin -attrdict diff --git a/requirements/requirements_nlp.txt b/requirements/requirements_nlp.txt index 60b5f92234af..18de20f9200f 100644 --- a/requirements/requirements_nlp.txt +++ b/requirements/requirements_nlp.txt @@ -9,5 +9,5 @@ numpy tqdm>=4.41.0 rapidfuzz gdown -megatron-lm>=1.1.3 +megatron-lm>=1.1.4 inflect diff --git a/setup.py b/setup.py index f2331942ec0e..49aea01bcd5f 100644 --- a/setup.py +++ b/setup.py @@ -89,7 +89,6 @@ def req_file(filename, folder="requirements"): extras_require = { # User packages - 'docker': req_file("requirements_docker.txt"), 'test': req_file("requirements_test.txt"), # Collections Packages 'asr': req_file("requirements_asr.txt"),