Is train a function or dataset ? This implies function…
train(model, train_loader, valid_loader, exp_name="MultiHead", epochs=1000)

But this implies dataset…
train = Dataset('./Dataset/Input','./Dataset/ToRec','./Dataset/Train.csv')

I think you are calling the dataset instead of the train function…