Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: unlabeled_train_iter.next() #29

Open
SSSXHJDB opened this issue Apr 2, 2022 · 4 comments
Open

KeyError: unlabeled_train_iter.next() #29

SSSXHJDB opened this issue Apr 2, 2022 · 4 comments

Comments

@SSSXHJDB
Copy link

SSSXHJDB commented Apr 2, 2022

%run /code/train.py --gpu=0 --n-labeled=10 --data-path /yahoo_answers_csv/ --batch-size=4 --batch-size-u=8 --epochs=50 --val-iteration=20 --lambda-u=0 --T=0.5 --alpha=16 --mix-layers-set 7 9 12 --separate-mix=True

train(labeled_trainloader, unlabeled_trainloader, model, optimizer, scheduler, criterion, epoch, n_labels, train_aug)
204 (inputs_u, inputs_u2, inputs_ori), (length_u,
--> 205 length_u2, length_ori) = unlabeled_train_iter.next()
206 except:

/torch/utils/data/dataloader.py in next(self)
520 self._reset()
--> 521 data = self._next_data()
522 self._num_yielded += 1

/torch/utils/data/dataloader.py in _next_data(self)
560 index = self._next_index() # may raise StopIteration
--> 561 data = self._dataset_fetcher.fetch(index) # may raise StopIteration
562 if self._pin_memory:

/torch/utils/data/_utils/fetch.py in fetch(self, possibly_batched_index)
43 if self.auto_collation:
---> 44 data = [self.dataset[idx] for idx in possibly_batched_index]
45 else:

/torch/utils/data/_utils/fetch.py in (.0)
43 if self.auto_collation:
---> 44 data = [self.dataset[idx] for idx in possibly_batched_index]
45 else:

/code/read_data.py in getitem(self, idx)
209 if self.aug is not None:
--> 210 u, v, ori = self.aug(self.text[idx], self.ids[idx])
211 encode_result_u, length_u = self.get_tokenized(u)

/code/read_data.py in call(self, ori, idx)
22 def call(self, ori, idx):
---> 23 out1 = self.de[idx]
24 out2 = self.ru[idx]

KeyError: 9226

May I ask what is the reason for this place? Thank you very much.

@LauJames
Copy link

LauJames commented Jun 1, 2022

I have met the same issue...

@kehanguo
Copy link

kehanguo commented Aug 9, 2022

I have the same issue. Did anyone solve it yet?

@jiaaoc
Copy link
Member

jiaaoc commented Sep 21, 2022

This might be related to the dictionary file about the back-translations. This might be because several sentences are not back-translated, like the 9226th sentence.

@2514099958
Copy link

Has anyone already downloaded the preprocessed dataset? The original URL is invalid, can anyone share the preprocessed dataset? Many thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants