You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File ~/.pyenv/versions/3.9.7/lib/python3.9/site-packages/torch/utils/data/dataloader.py:633, in _BaseDataLoaderIter.next(self)
630 if self._sampler_iter is None:
631 # TODO(pytorch/pytorch#76750)
632 self._reset() # type: ignore[call-arg]
--> 633 data = self._next_data()
634 self._num_yielded += 1
635 if self._dataset_kind == _DatasetKind.Iterable and
636 self._IterableDataset_len_called is not None and
637 self._num_yielded > self._IterableDataset_len_called:
EmbeddingsPyTorch.ipynb
train_loader = torch.utils.data.DataLoader(train_dataset, batch_size=16, collate_fn=offsetify, shuffle=True) train_epoch_emb(net,train_loader, lr=4, epoch_size=25000)
AttributeError Traceback (most recent call last)
/Users/mouseart/OneDrive/book/AI-For-Beginners-Code/lessons/5-NLP/14-Embeddings/EmbeddingsPyTorch.ipynb 单元格 37 line 2
1 train_loader = torch.utils.data.DataLoader(train_dataset, batch_size=16, collate_fn=offsetify, shuffle=True)
----> 2 train_epoch_emb(net,train_loader, lr=4, epoch_size=25000)
/Users/mouseart/OneDrive/book/AI-For-Beginners-Code/lessons/5-NLP/14-Embeddings/EmbeddingsPyTorch.ipynb 单元格 37 line 8
6 net.train()
7 total_loss,acc,count,i = 0,0,0,0
----> 8 for labels,text,off in dataloader:
9 optimizer.zero_grad()
10 labels,text,off = labels.to(device), text.to(device), off.to(device)
File ~/.pyenv/versions/3.9.7/lib/python3.9/site-packages/torch/utils/data/dataloader.py:633, in _BaseDataLoaderIter.next(self)
630 if self._sampler_iter is None:
631 # TODO(pytorch/pytorch#76750)
632 self._reset() # type: ignore[call-arg]
--> 633 data = self._next_data()
634 self._num_yielded += 1
635 if self._dataset_kind == _DatasetKind.Iterable and
636 self._IterableDataset_len_called is not None and
637 self._num_yielded > self._IterableDataset_len_called:
File ~/.pyenv/versions/3.9.7/lib/python3.9/site-packages/torch/utils/data/dataloader.py:677, in _SingleProcessDataLoaderIter._next_data(self)
675 def _next_data(self):
...
---> 33 stoi = v.get_stoi()
34 stoi_hash[v]=stoi
35 return [stoi.get(s,unk) for s in tokenizer(x)]
AttributeError: 'GloVe' object has no attribute 'get_stoi'
The text was updated successfully, but these errors were encountered: