Runtime error shape invalid for input size

Hello, could someone help me please? Im using tacotron training notebook on google collab and I have a error :

hparams to Tune

#These two are the most important

hparams.batch_size = 10 # Controls how fast the model trains. Don’t set this too high, or else it will GPU will OOM (out of memory). 30-ish is usually a good number if you have a bigger dataset. If the number of audio files is more than/about the same as this number, it won’t train properly, and you won’t be able to use it.

hparams.epochs = 500 # Maxmimum epochs (number of times the AI looks through the dataset) to train

#The rest aren’t that important



hparams.decay_start = 15000 # wait till decay_start to start decaying learning rate

hparams.A_ = 5e-4 # Start/Max Learning Rate

hparams.B_ = 8000 # Decay Rate

hparams.C_ = 0 # Shift learning rate equation by this value

hparams.min_learning_rate = 1e-5 # Min Learning Rate

generate_mels = True # Don’t change

hparams.show_alignments = True

alignment_graph_height = 600

alignment_graph_width = 1000

hparams.load_mel_from_disk = True

hparams.ignore_layers = [] # Layers to reset (None by default, other than foreign languages this param can be ignored)

torch.backends.cudnn.enabled = hparams.cudnn_enabled

torch.backends.cudnn.benchmark = hparams.cudnn_benchmark

output_directory = ‘/content/drive/My Drive/colab/outdir’ # Location to save Checkpoints

log_directory = ‘/content/tacotron2/logs’ # Location to save Log files locally

log_directory2 = ‘/content/drive/My Drive/colab/logs’ # Location to copy log files (done at the end of each epoch to cut down on I/O)

checkpoint_path = output_directory+(r’/’)+model_filename

if generate_mels:


RuntimeError: shape ‘[1, 1, 83256]’ is invalid for input of size 166512

A shape mismatch error is often created by a wrongly shaped input.
I don’t know what the shape of your current input is and what shape is expected, but you might want to check the reference implementations and what inputs are used in the original code.

PS: you can post code snippets by wrapping them into three backticks ```, which makes debugging easier :wink: