for epoch in range(NUM_EPOCHS):
model.train()
for batch_idx, batch in enumerate(train_loader):
### Prepare data
input_ids = batch['input_ids'].to(DEVICE)
attention_mask = batch['attention_mask'].to(DEVICE)
labels = batch['labels'].to(DEVICE)
### Forward
outputs = model(input_ids, attention_mask=attention_mask, labels=labels) **
loss, logits = outputs['loss'], outputs['logits']
this is returning error :
RuntimeError: The size of tensor a (3157) must match the size of tensor b (512) at non-singleton dimension 1
i did everything just like the book says
this is returning error :
i did everything just like the book says