Getting error when making inference using nemo ASR pretrained model converted to pytroch mobile model: RuntimeError: Given groups=64, weight of size [64, 1, 33], expected input[1, 1, 63840] to have 64 channels, but got 1 channels instead
State: closed | Pull request: no

I am trying to make inference (Audio to text ASR )on nemo model converted to pytorch mobile lite model, but i am facing issue in mismatch. Can someone help me please. 

my_code

import torch
from torch import Tensor
from torch.utils.mobile_optimizer import optimize_for_mobile
import torchaudio
import nemo.collections.asr as nemo_asr

model = nemo_asr.models.EncDecCTCModel.from_pretrained(model_name, map_location='cpu')
model.export('model.pt')

model2 = torch.load('model.pt', map_location=torch.device('cpu'))

model2.eval()

quantized_model = torch.quantization.convert(model2)
scripted_model = torch.jit.script(quantized_model)
optimized_model = optimize_for_mobile(scripted_model)
optimized_model._save_for_lite_interpreter("quartz.ptl")

model3 = torch.load('quartz.ptl', map_location=torch.device('cpu'))
model3.eval()

class EncDecCTCModel(torch.nn.Module):
    def __init__(self, model):
        super().__init__()
        self.model = model
        self.labels = [" ", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
         "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "'"]

    def forward(self, waveforms: Tensor) -> str:
        """Given a single channel speech data, return transcription.
        Args:
            waveforms (Tensor): Speech tensor. Shape `[1, num_frames]`.
        Returns:
            str: The resulting transcript
        """
        logits, _ = self.model(waveforms)  # [batch, num_seq, num_label]
        logits = torch.from_numpy(logits[0])
        best_path = logits.argmax(dim=-1, keepdim=False)
        #best_path = torch.argmax(logits[0], dim=-1)  # [num_seq,]
        print(best_path.size())
        prev = ''
        hypothesis = ''
        for i in best_path:
            
            char = self.labels[i]
            if char == prev:
                continue
            if char == " ":
                prev = ''
                continue
            hypothesis += char
            prev = char
        return hypothesis

model3 = torch.load('quartz.ptl', map_location=torch.device('cpu'))
model3.eval()

model = EncDecCTCModel(model3)

waveform , sample_rat = torchaudio.load('84-121123-0001.wav')
waveform=waveform.unsqueeze(0)

print('Result:', model(waveform))

RuntimeError: The following operation failed in the TorchScript interpreter.
Traceback of TorchScript, serialized code (most recent call last):
  File "code/__torch__/nemo/collections/asr/models/ctc_models/___torch_mangle_2795.py", line 7, in forward
  def forward(self: __torch__.nemo.collections.asr.models.ctc_models.___torch_mangle_2795.EncDecCTCModel,
    input: Tensor) -> Tensor:
    _0 = torch.conv1d(input, CONSTANTS.c0, None, [2], [16], [1], 64)
         ~~~~~~~~~~~~ <--- HERE
    input0 = torch.batch_norm(torch.conv1d(_0, CONSTANTS.c1), CONSTANTS.c2, CONSTANTS.c3, CONSTANTS.c4, CONSTANTS.c5, False, 0.10000000000000001, 0.001, True)
    _1 = torch.relu_(input0)

Traceback of TorchScript, original code (most recent call last):
          %transposed:bool, %output_padding:int[], %groups:int, %benchmark:bool,
          %deterministic:bool, %cudnn_enabled:bool, %allow_tf32:bool):
        %r = aten::conv1d(%a, %w, %b, %stride, %padding, %dilation, %groups)
             ~~~~ <--- HERE
        return (%r) 
RuntimeError: Given groups=64, weight of size [64, 1, 33], expected input[1, 1, 63840] to have 64 channels, but got 1 channels instead

Is this is the right method to give input to the nemo converted pytorch mobile model?
 If not how to give the input to the mobile model and return the text when audio input is given . Please help me