This is caused because you have tried to input a raw DataFrame into the pytorch NN
First of all,  you can’t pass a raw DataFrame as input to a DataLoader class.
DataLoader expects a  dataset object to load data from.  See DataLoader Document  33
So you have to make a dataset object . In order to do this you need to first convert the dataframe into a pytorch tensor. You can do this by ,
X_train_tensor = torch.from_numpy(X_train.values)

I assume that you also have a Y_train DataFrame , so make a tensor from it too
Y_train_tensor = torch.from_numpy(Y_train.values)

Then as needed we then create a dataset using this 9
train_dataset = torch.utils.data.TensorDataset(X_train_tensor, 
                                                Y_train_tensor)

Now we can create a DataLoader out of this. Refer documentation 33 for **kwargs
train_loader = torch.utils.data.DataLoader(train_dataset, batch_size, 
                                             shuffle=True)

And this train_loader is kind of a python generator, so you can’t just  input this directly into the model.forward . (You have to iterate this train_loader)
I have implemented  a example of a training loop using these below
for e in range(epochs):
        for  i, (data, labels) in enumerate(train_loader):  #iterate through each batch
                  optimizer.zero_grad()
                  output = model.forward(data)
                  loss = criterion(output.squeeze(), labels)
                  print (f'Epoch - {i+1}, Loss - {round(loss.item(),3)}')
                  loss.backward()
                  optimizer.step()

Hope this helps.