2021-11-14 19:41:27,826] Trial 0 failed because of the following error: RuntimeError(‘input.size(-1) must be equal to input_size. Expected 128, got 1’)
Traceback (most recent call last):
File “/opt/miniconda3/lib/python3.9/site-packages/optuna/study/_optimize.py”, line 213, in _run_trial
value_or_values = func(trial)
File “/Users/hussamaleem/Documents/SEEM Assignment/Shared Temporal Attention augmented LSTM Encoder Decoder/main_trial.py”, line 108, in objective
pred_l, actual_l, trn_loss = train_test.training_loop(training_data, model, device,
File “/Users/hussamaleem/Documents/SEEM Assignment/Shared Temporal Attention augmented LSTM Encoder Decoder/train_test.py”, line 65, in training_loop
y_pred = model(s, label, use_teacher_forcing)
File “/opt/miniconda3/lib/python3.9/site-packages/torch/nn/modules/module.py”, line 1102, in _call_impl
return forward_call(*input, **kwargs)
File “/Users/hussamaleem/Documents/SEEM Assignment/Shared Temporal Attention augmented LSTM Encoder Decoder/models.py”, line 135, in forward
output = ablation(src, trg, use_teacher_forcing)
File “/Users/hussamaleem/Documents/SEEM Assignment/Shared Temporal Attention augmented LSTM Encoder Decoder/models.py”, line 97, in ablation_1
out, hidden, cell = self.decoder_lstm(decoder_input, hidden, cell)
File “/opt/miniconda3/lib/python3.9/site-packages/torch/nn/modules/module.py”, line 1102, in _call_impl
return forward_call(*input, **kwargs)
File “/Users/hussamaleem/Documents/SEEM Assignment/Shared Temporal Attention augmented LSTM Encoder Decoder/modules/encoder_decoder.py”, line 91, in forward
output, (hidden,cell) = self.lstm(dec_input, (hidden,cell))
File “/opt/miniconda3/lib/python3.9/site-packages/torch/nn/modules/module.py”, line 1102, in _call_impl
return forward_call(*input, **kwargs)
File “/opt/miniconda3/lib/python3.9/site-packages/torch/nn/modules/rnn.py”, line 689, in forward
File “/opt/miniconda3/lib/python3.9/site-packages/torch/nn/modules/rnn.py”, line 632, in check_forward_args
):
File “/opt/miniconda3/lib/python3.9/site-packages/torch/nn/modules/rnn.py”, line 205, in check_input
if self.input_size != input.size(-1):
RuntimeError: input.size(-1) must be equal to input_size. Expected 128, got 1
Traceback (most recent call last):
File “/var/folders/r5/qgh43p4j4dqgtxt1w69n502r0000gn/T/ipykernel_17568/1817966163.py”, line 1, in 
runfile(’/Users/hussamaleem/Documents/SEEM Assignment/Shared Temporal Attention augmented LSTM Encoder Decoder/main_trial.py’, wdir=’/Users/hussamaleem/Documents/SEEM Assignment/Shared Temporal Attention augmented LSTM Encoder Decoder’)
File “/opt/miniconda3/lib/python3.9/site-packages/debugpy/_vendored/pydevd/_pydev_bundle/pydev_umd.py”, line 167, in runfile
execfile(filename, namespace)
File “/opt/miniconda3/lib/python3.9/site-packages/debugpy/_vendored/pydevd/_pydev_imps/_pydev_execfile.py”, line 25, in execfile
exec(compile(contents + “\n”, file, ‘exec’), glob, loc)
File “/Users/hussamaleem/Documents/SEEM Assignment/Shared Temporal Attention augmented LSTM Encoder Decoder/main_trial.py”, line 140, in 
study.optimize(objective, n_trials=200)
File “/opt/miniconda3/lib/python3.9/site-packages/optuna/study/study.py”, line 400, in optimize
_optimize(
File “/opt/miniconda3/lib/python3.9/site-packages/optuna/study/_optimize.py”, line 66, in _optimize
_optimize_sequential(
File “/opt/miniconda3/lib/python3.9/site-packages/optuna/study/_optimize.py”, line 163, in _optimize_sequential
trial = _run_trial(study, func, catch)
File “/opt/miniconda3/lib/python3.9/site-packages/optuna/study/_optimize.py”, line 264, in _run_trial
raise func_err
File “/opt/miniconda3/lib/python3.9/site-packages/optuna/study/_optimize.py”, line 213, in _run_trial
value_or_values = func(trial)
File “/Users/hussamaleem/Documents/SEEM Assignment/Shared Temporal Attention augmented LSTM Encoder Decoder/main_trial.py”, line 108, in objective
pred_l, actual_l, trn_loss = train_test.training_loop(training_data, model, device,
File “/Users/hussamaleem/Documents/SEEM Assignment/Shared Temporal Attention augmented LSTM Encoder Decoder/train_test.py”, line 65, in training_loop
y_pred = model(s, label, use_teacher_forcing)
File “/opt/miniconda3/lib/python3.9/site-packages/torch/nn/modules/module.py”, line 1102, in _call_impl
return forward_call(*input, **kwargs)
File “/Users/hussamaleem/Documents/SEEM Assignment/Shared Temporal Attention augmented LSTM Encoder Decoder/models.py”, line 135, in forward
output = ablation(src, trg, use_teacher_forcing)
File “/Users/hussamaleem/Documents/SEEM Assignment/Shared Temporal Attention augmented LSTM Encoder Decoder/models.py”, line 97, in ablation_1
out, hidden, cell = self.decoder_lstm(decoder_input, hidden, cell)
File “/opt/miniconda3/lib/python3.9/site-packages/torch/nn/modules/module.py”, line 1102, in _call_impl
return forward_call(*input, **kwargs)
File “/Users/hussamaleem/Documents/SEEM Assignment/Shared Temporal Attention augmented LSTM Encoder Decoder/modules/encoder_decoder.py”, line 91, in forward
output, (hidden,cell) = self.lstm(dec_input, (hidden,cell))
File “/opt/miniconda3/lib/python3.9/site-packages/torch/nn/modules/module.py”, line 1102, in _call_impl
return forward_call(*input, **kwargs)
File “/opt/miniconda3/lib/python3.9/site-packages/torch/nn/modules/rnn.py”, line 689, in forward
File “/opt/miniconda3/lib/python3.9/site-packages/torch/nn/modules/rnn.py”, line 632, in check_forward_args
):
File “/opt/miniconda3/lib/python3.9/site-packages/torch/nn/modules/rnn.py”, line 205, in check_input
if self.input_size != input.size(-1):
RuntimeError: input.size(-1) must be equal to input_size. Expected 128, got 1
This is the complete error.