Fit failing with RuntimeError: Could not infer dtype of numpy.int64

Thanks! Updated guide here:

The biggest issue now is that the ‘troubleshooting’ page only covers local installation - not troubleshooting for gradient/gcp/etc. So a really help PR would be something at the top that points people to the setup guides on course-v3.fast.ai.

Hi,

I am running into the same problem when I create a TextClasDataBunch. I tried a fresh installation in a new environment and the problem persists. For this project I’m on a linux operating system. The full stack trace is as below:

Traceback (most recent call last):
 File "train.py", line 40, in <module>
 LSTM.train()
File "train.py", line 33, in train
for batch_idx, (data,target) in enumerate(self.train_dataloader):
File "/homes/anand39/.pyenv/versions/DL_venv/lib/python3.6/site-packages/fastai/basic_data.py", line 82, in __iter__
for b in self.dl: yield self.proc_batch(b)
File "/homes/anand39/.pyenv/versions/DL_venv/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 314, in __next__
batch = self.collate_fn([self.dataset[i] for i in indices])
File "/homes/anand39/.pyenv/versions/DL_venv/lib/python3.6/site-packages/fastai/text/data.py", line 273, in pad_collate
return res, tensor([s[1] for s in samples])
File "/homes/anand39/.pyenv/versions/DL_venv/lib/python3.6/site-packages/fastai/torch_core.py", line 67, in tensor
return torch.tensor(x) if is_listy(x) else as_tensor(x)
RuntimeError: Could not infer dtype of numpy.int64

Is there any fix to this problem at the current time?

Edit: Please ignore, it was an installation problem and it works now!

@sgugger I am not able to install Pytorch v1 in Google colab. Any fix for this?

The link is not working.

This should do the trick: https://docs.fast.ai/troubleshoot.html