Getting 'numpy.int64' object is not callable and "Size mismatch between tensors" errors in PyTorch while building an MLP

228 Views Asked by At

I have 4 text files,one of which includes x1,x2,x3 as training features and the other one is y for labels and the same applies to testing.
I have to construct a Multi Layer Perceptron (MLP) model in Pytorch and what I did was to load these text files to PyTorch under the names of x_train,y_train,x_test and y_test.
However when I run the code below:

dataset_train = data.TensorDataset(x_train,y_train)
dataloader_train =data.DataLoader(dataset_train, batch_size=10, shuffle=True,num_workers=0)

I get this error :

'numpy.int64' object is not callable

I also see this : Size mismatch between tensors.
please help me with this error,what does it mean and what I have to change ?

0

There are 0 best solutions below