Could somebody help me. I am new to Pytorch and am trying to predict house prices. I am always getting the following error: Found dtype Long but expected Float.
My Notebook: https://colab.research.google.com/drive/1Vd9fJs0bfd7IZ8D5dHS859EThz1DEB58?usp=sharing 1
#Doesn't Work
epochs=500
final_losses=[]
for i in range(epochs):
    i=i+1
    y_pred=model.forward(X_train)
    y_pred=y_pred#.to(torch.float32)#.float()
    #print(y_pred.type())
    loss=loss_function(y_pred,y_train)#.float()
    #print("Loss: ",loss.type())
    final_losses.append(loss)
    if i%10==1:
        print("Epoch number: {} and the loss : {}".format(i,loss.item()))
    optimizer.zero_grad()
    loss.backward()
    optimizer.step()

Any help would be highly appreciated.