I am trying to run the code in Chapter 16, Page 580
I encountered an error:
start_time = time.time()
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']
RuntimeError: "nll_loss_forward_reduce_cuda_kernel_2d_index" not implemented for 'Int'
File , line 15
12 labels = batch['labels'].to(DEVICE)
14 ### Forward
---> 15 outputs = model(input_ids, attention_mask=attention_mask, labels=labels)
The code is exactly the same, except I read the csv file from spark and then converted it to pandas dataframe.
I would like to know, What are the correct column data types for 'review' and 'sentiment' columns?
my column type for 'sentiment' column is integer. I am not sure if it is correct?
Hello,
I am trying to run the code in Chapter 16, Page 580
I encountered an error:
RuntimeError: "nll_loss_forward_reduce_cuda_kernel_2d_index" not implemented for 'Int' File, line 15
12 labels = batch['labels'].to(DEVICE)
14 ### Forward
---> 15 outputs = model(input_ids, attention_mask=attention_mask, labels=labels)
The code is exactly the same, except I read the csv file from spark and then converted it to pandas dataframe.
I would like to know, What are the correct column data types for 'review' and 'sentiment' columns? my column type for 'sentiment' column is integer. I am not sure if it is correct?
Or the error was caused by somewhere else?