Working with a fake news dataset for NLP as in Lesson 3, when I run:
data_lm = TextLMDataBunch.load(path, 'tmp_lm')
data_lm.show_batch()
I get: TypeError: can’t convert np.ndarray of type numpy.object_.
TypeError Traceback (most recent call last)
<ipython-input-65-f346687833ba> in <module>
----> 1 data_lm.show_batch()
/opt/conda/envs/fastai/lib/python3.6/site-packages/fastai/text/data.py in show_batch(self, sep, ds_type, rows, max_len)
224 from IPython.display import display, HTML
225 dl = self.dl(ds_type)
--> 226 x,y = next(iter(dl))
227 items = [['idx','text']]
228 for i in range(rows):
/opt/conda/envs/fastai/lib/python3.6/site-packages/fastai/basic_data.py in __iter__(self)
45 def __iter__(self):
46 "Process and returns items from `DataLoader`."
---> 47 for b in self.dl:
48 y = b[1][0] if is_listy(b[1]) else b[1]
49 if not self.skip_size1 or y.size(0) != 1: yield self.proc_batch(b)
/opt/conda/envs/fastai/lib/python3.6/site-packages/fastai/text/data.py in __iter__(self)
25 yield LongTensor(getattr(self.dataset, 'item')).unsqueeze(1),LongTensor([0])
26 idx = np.random.permutation(len(self.dataset)) if self.shuffle else range(len(self.dataset))
---> 27 self.data = self.batchify(np.concatenate([self.dataset.x.items[i] for i in idx]))
28 self.i,self.iter = 0,0
29 while self.i < self.n-1 and self.iter<len(self):
/opt/conda/envs/fastai/lib/python3.6/site-packages/fastai/text/data.py in batchify(self, data)
46 data = np.array(data[:nb*self.bs]).reshape(self.bs, -1).T
47 if self.backwards: data=data[::-1].copy()
---> 48 return LongTensor(data)
49
50 def get_batch(self, i:int, seq_len:int) -> Tuple[LongTensor, LongTensor]:
I get the same error running lr_find().
Anybody have suggestions?