Skip to content
This repository has been archived by the owner on Aug 3, 2021. It is now read-only.

Unable to initialize FrameASR object (Trying to infer from Pre-trained model) #533

Open
swapnil3597 opened this issue Apr 7, 2020 · 1 comment

Comments

@swapnil3597
Copy link

I'm trying to transcribe the audio from pre-trained model as shown in Streaming-ASR.ipynb and demo_streaming_asr.py. I have changed the MODEL_PARAMS in frame_asr.py as shown below (config and checkpoint obtained from here):

MODEL_PARAMS = ["--config_file=example_configs/speech2text/jasper10x5_LibriSpeech_nvgrad_masks.py",
                "--mode=interactive_infer",
                "--logdir=../checkpoint/",
                "--batch_size_per_gpu=1",
                "--num_gpus=1",
                "--use_horovod=False",
                "--decoder_params/infer_logits_to_pickle=True",
                "--data_layer_params/pad_to=0"
]

But when I try to initialize the FrameASR object as asr = FrameASR() I get the following error. How Am I suppose to provide dataset_files when I'm trying to get inference from pre-trained model.

Error:

Traceback (most recent call last):
  File "demo_offline_streaming.py", line 21, in <module>
    main()
  File "demo_offline_streaming.py", line 13, in main
    asr = FrameASR()
  File "/workspace/OpenSeq2Seq/frame_asr.py", line 67, in __init__
    self.model_S2T, checkpoint_S2T = self._get_model(model_params, scope_name)
  File "/workspace/OpenSeq2Seq/frame_asr.py", line 283, in _get_model
    model = create_model(args, base_config, config_module, base_model, None)
  File "/workspace/OpenSeq2Seq/open_seq2seq/utils/utils.py", line 879, in create_model
    model = base_model(params=infer_config, mode=args.mode, hvd=hvd)
  File "/workspace/OpenSeq2Seq/open_seq2seq/models/encoder_decoder.py", line 66, in __init__
    super(EncoderDecoderModel, self).__init__(params=params, mode=mode, hvd=hvd)
  File "/workspace/OpenSeq2Seq/open_seq2seq/models/model.py", line 341, in __init__
    num_workers=self.num_gpus, worker_id=worker_id,
  File "/workspace/OpenSeq2Seq/open_seq2seq/data/speech2text/speech2text.py", line 110, in __init__
    num_workers, worker_id)
  File "/workspace/OpenSeq2Seq/open_seq2seq/data/data_layer.py", line 76, in __init__
    check_params(params, self.get_required_params(), self.get_optional_params())
  File "/workspace/OpenSeq2Seq/open_seq2seq/utils/utils.py", line 409, in check_params
    raise ValueError("{} parameter has to be specified".format(pm))
ValueError: dataset_files parameter has to be specified
@aadil-srivastava01
Copy link

aadil-srivastava01 commented May 4, 2020

"--decoder_params/infer_logits_to_pickle=True"

Have you defined "interactive_infer_params" in your configuration file? If not add that, for example:

interactive_infer_params = { "data_layer": Speech2TextDataLayer, "data_layer_params": { "num_audio_features": 64, "input_type": "logfbank", "vocab_file": "open_seq2seq/test_utils/toy_speech_data/vocab.txt", "dataset_files": [], "shuffle": False, }, }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants