import nemo.collections.asr fails
State: closed | Pull request: no
Labels: name: bug

**Describe the bug**

`import nemo.collections.asr` fails, producing the following error:

```$ python import_test.py 
[NeMo W 2021-07-12 13:38:25 optimizers:47] Apex was not found. Using the lamb optimizer will error out.
[NeMo W 2021-07-12 13:38:36 optimizers:47] Apex was not found. Using the lamb optimizer will error out.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/Nicholas.Moran/miniconda3/envs/nemo/lib/python3.9/multiprocessing/spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "/Users/Nicholas.Moran/miniconda3/envs/nemo/lib/python3.9/multiprocessing/spawn.py", line 125, in _main
    prepare(preparation_data)
  File "/Users/Nicholas.Moran/miniconda3/envs/nemo/lib/python3.9/multiprocessing/spawn.py", line 236, in prepare
    _fixup_main_from_path(data['init_main_from_path'])
  File "/Users/Nicholas.Moran/miniconda3/envs/nemo/lib/python3.9/multiprocessing/spawn.py", line 287, in _fixup_main_from_path
    main_content = runpy.run_path(main_path,
  File "/Users/Nicholas.Moran/miniconda3/envs/nemo/lib/python3.9/runpy.py", line 268, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/Users/Nicholas.Moran/miniconda3/envs/nemo/lib/python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/Users/Nicholas.Moran/miniconda3/envs/nemo/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/Users/Nicholas.Moran/NeMo/import_test.py", line 1, in <module>
    import nemo.collections.asr
  File "/Users/Nicholas.Moran/NeMo/nemo/collections/asr/__init__.py", line 15, in <module>
    from nemo.collections.asr import data, losses, models, modules
  File "/Users/Nicholas.Moran/NeMo/nemo/collections/asr/models/__init__.py", line 17, in <module>
    from nemo.collections.asr.models.clustering_diarizer import ClusteringDiarizer
  File "/Users/Nicholas.Moran/NeMo/nemo/collections/asr/models/clustering_diarizer.py", line 31, in <module>
    from nemo.collections.asr.models.label_models import ExtractSpeakerEmbeddingsModel
  File "/Users/Nicholas.Moran/NeMo/nemo/collections/asr/models/label_models.py", line 32, in <module>
    from nemo.collections.asr.parts.utils.speaker_utils import embedding_normalize
  File "/Users/Nicholas.Moran/NeMo/nemo/collections/asr/parts/utils/speaker_utils.py", line 24, in <module>
    from pyannote.metrics.diarization import DiarizationErrorRate
  File "/Users/Nicholas.Moran/miniconda3/envs/nemo/lib/python3.9/site-packages/pyannote/metrics/__init__.py", line 40, in <module>
    manager_ = Manager()
  File "/Users/Nicholas.Moran/miniconda3/envs/nemo/lib/python3.9/multiprocessing/context.py", line 57, in Manager
    m.start()
  File "/Users/Nicholas.Moran/miniconda3/envs/nemo/lib/python3.9/multiprocessing/managers.py", line 553, in start
    self._process.start()
  File "/Users/Nicholas.Moran/miniconda3/envs/nemo/lib/python3.9/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/Users/Nicholas.Moran/miniconda3/envs/nemo/lib/python3.9/multiprocessing/context.py", line 284, in _Popen
    return Popen(process_obj)
  File "/Users/Nicholas.Moran/miniconda3/envs/nemo/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/Users/Nicholas.Moran/miniconda3/envs/nemo/lib/python3.9/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/Users/Nicholas.Moran/miniconda3/envs/nemo/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 42, in _launch
    prep_data = spawn.get_preparation_data(process_obj._name)
  File "/Users/Nicholas.Moran/miniconda3/envs/nemo/lib/python3.9/multiprocessing/spawn.py", line 154, in get_preparation_data
    _check_not_importing_main()
  File "/Users/Nicholas.Moran/miniconda3/envs/nemo/lib/python3.9/multiprocessing/spawn.py", line 134, in _check_not_importing_main
    raise RuntimeError('''
RuntimeError: 
        An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

        This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:

            if __name__ == '__main__':
                freeze_support()
                ...

        The "freeze_support()" line can be omitted if the program
        is not going to be frozen to produce an executable.
Traceback (most recent call last):
  File "/Users/Nicholas.Moran/NeMo/import_test.py", line 1, in <module>
    import nemo.collections.asr
  File "/Users/Nicholas.Moran/NeMo/nemo/collections/asr/__init__.py", line 15, in <module>
    from nemo.collections.asr import data, losses, models, modules
  File "/Users/Nicholas.Moran/NeMo/nemo/collections/asr/models/__init__.py", line 17, in <module>
    from nemo.collections.asr.models.clustering_diarizer import ClusteringDiarizer
  File "/Users/Nicholas.Moran/NeMo/nemo/collections/asr/models/clustering_diarizer.py", line 31, in <module>
    from nemo.collections.asr.models.label_models import ExtractSpeakerEmbeddingsModel
  File "/Users/Nicholas.Moran/NeMo/nemo/collections/asr/models/label_models.py", line 32, in <module>
    from nemo.collections.asr.parts.utils.speaker_utils import embedding_normalize
  File "/Users/Nicholas.Moran/NeMo/nemo/collections/asr/parts/utils/speaker_utils.py", line 24, in <module>
    from pyannote.metrics.diarization import DiarizationErrorRate
  File "/Users/Nicholas.Moran/miniconda3/envs/nemo/lib/python3.9/site-packages/pyannote/metrics/__init__.py", line 40, in <module>
    manager_ = Manager()
  File "/Users/Nicholas.Moran/miniconda3/envs/nemo/lib/python3.9/multiprocessing/context.py", line 57, in Manager
    m.start()
  File "/Users/Nicholas.Moran/miniconda3/envs/nemo/lib/python3.9/multiprocessing/managers.py", line 557, in start
    self._address = reader.recv()
  File "/Users/Nicholas.Moran/miniconda3/envs/nemo/lib/python3.9/multiprocessing/connection.py", line 255, in recv
    buf = self._recv_bytes()
  File "/Users/Nicholas.Moran/miniconda3/envs/nemo/lib/python3.9/multiprocessing/connection.py", line 419, in _recv_bytes
    buf = self._recv(4)
  File "/Users/Nicholas.Moran/miniconda3/envs/nemo/lib/python3.9/multiprocessing/connection.py", line 388, in _recv
    raise EOFError
EOFError
```

Here import_test.py is a file which contains a single line: `import nemo.collections.asr`.

However, when run from ipython, the same import works fine:

```$ python -i
Python 3.9.5 (default, May 18 2021, 12:31:01) 
[Clang 10.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import nemo.collections.asr
[NeMo W 2021-07-12 13:37:26 optimizers:47] Apex was not found. Using the lamb optimizer will error out.
[NeMo W 2021-07-12 13:37:43 experimental:27] Module <class 'nemo.collections.asr.data.audio_to_text_dali.AudioToCharDALIDataset'> is experimental, not ready for production and is not fully supported. Use at your own risk.
```
Note that in the previous output, the Apex warning was printed twice - this makes me suspect that some portion of the import code is being incorrectly run twice, ultimately resulting in the error from the multiprocessing library.  I haven't been able to further narrow down the problem, however.

**Steps/Code to reproduce bug**

`import nemo.collections.asr`

**Expected behavior**

The import works fine in ipython, so I would have expected it to work the same from a script file.

**Environment overview (please complete the following information)**

Mac OS Catalina 10.15.7
Installed by cloning the git repo and running `./reinstall.sh`.  I have also tried installing via `pip install nemo-toolkit`, and `pip install git+https://github.com/NVIDIA/NeMo.git@$BRANCH#egg=nemo_toolkit[all]` , with both 'main' and 'r1.1.0' for BRANCH.  These all produced the same result.

**Environment details**

Python 3.9.5
PyTorch 1.9.0

**Additional context**