Question: the code generates following error - Error encountered during training / evaluation letter counting. Please check code. Traceback ( most recent call last ) :

the code generates following error- Error encountered during training/evaluation letter counting. Please check code.
Traceback (most recent call last):
File "/autograder/source/code/wrapper.py", line 152, in
lc_model = train_lc_classifier(args, train_lc_bundles, dev_lc_bundles)
File "/autograder/source/code/transformer.py", line 156, in train_classifier
output_batch_expanded = output_batch.unsqueeze(1).expand(-1, seq_length) # Expand the output batch
RuntimeError: expand(torch.LongTensor{[32,1,20]}, size=[-1,20]): the number of sizes provided (2) must be greater or equal to the number of dimensions in the tensor (3)
provide updated code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!