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

ValueError: Caught ValueError in DataLoader worker process 0. #4

Open
kemalaraz opened this issue Apr 13, 2020 · 2 comments
Open

ValueError: Caught ValueError in DataLoader worker process 0. #4

kemalaraz opened this issue Apr 13, 2020 · 2 comments

Comments

@kemalaraz
Copy link

@@@@@@@@@@@ args @@@@@@@@@@@
{'metric': 'micro_f1', 'cuda_device': 3, 'seed': 31415926535897932, 'opt': 'adam', 'use_cls': True, 'subject_1': False, 'large_bert': False, 'continue_train': False, 'eval': False, 'add_subject_loss': False, 'weight_decay': 1e-05, 'lr': 5e-05, 'max_epoch': 100, 'sort': False, 'softmax': False, 'num_workers': 2, 'dataset_name': 'nyt10', 'batch_size': 20}
@@@@@@@@@@@@@@@@@@@@@@@@@@@@
=== Epoch 0 train ===
  0%|                                                                                                                                                                              | 0/2840 [00:00<?, ?it/s]Traceback (most recent call last):
  File "redn_trainer.py", line 205, in <module>
    train(**args_list[0])
  File "redn_trainer.py", line 117, in train
    _framework.train_model(metric=metric)
  File "/home/turkai/kemal/REDN/opennre/framework/sentence_re.py", line 92, in train_model
    for iter, data in enumerate(t):
  File "/home/turkai/anaconda3/envs/redn/lib/python3.6/site-packages/tqdm/std.py", line 1081, in __iter__
    for obj in iterable:
  File "/home/turkai/anaconda3/envs/redn/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 819, in __next__
    return self._process_data(data)
  File "/home/turkai/anaconda3/envs/redn/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 846, in _process_data
    data.reraise()
  File "/home/turkai/anaconda3/envs/redn/lib/python3.6/site-packages/torch/_utils.py", line 385, in reraise
    raise self.exc_type(msg)
ValueError: Caught ValueError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "/home/turkai/anaconda3/envs/redn/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop
    data = fetcher.fetch(index)
  File "/home/turkai/anaconda3/envs/redn/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/turkai/anaconda3/envs/redn/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/turkai/kemal/REDN/opennre/framework/data_loader.py", line 143, in __getitem__
    seq_len)
  File "/home/turkai/kemal/REDN/opennre/framework/data_loader.py", line 155, in merge_ont_hot_labels
    em = SentenceREDataset.get_entity_mask(pos_head, pos_tail, new_index, seq_len)
  File "/home/turkai/kemal/REDN/opennre/framework/data_loader.py", line 164, in get_entity_mask
    pos_head = [new_index.index(i) for i in pos_head]
  File "/home/turkai/kemal/REDN/opennre/framework/data_loader.py", line 164, in <listcomp>
    pos_head = [new_index.index(i) for i in pos_head]
ValueError: 186 is not in list

I haven't changed anything but I am getting this error. What might be the reason? Alos tried with 0 num_workers, no luck so far.

Thanks

@slczgwh
Copy link
Owner

slczgwh commented Apr 14, 2020

It might be a following problem of this issue?

@kemalaraz
Copy link
Author

Yeah same problem when I uncommented that line problem solved but maximum token problem still exists training will take a bit of time I ll try to evaluate after training finishes and see if there is a performence porblem or not because of token issue.

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

2 participants