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

在训练到ford 3时遇到这个错误 #12

Open
Dioxideme opened this issue Jul 7, 2020 · 2 comments
Open

在训练到ford 3时遇到这个错误 #12

Dioxideme opened this issue Jul 7, 2020 · 2 comments

Comments

@Dioxideme
Copy link

Start train 3 ford
Calling BertTokenizer.from_pretrained() with the path to a single file or url is deprecated
The current process just got forked. Disabling parallelism to avoid deadlocks...
To disable this warning, please explicitly set TOKENIZERS_PARALLELISM=(true | false)
The current process just got forked. Disabling parallelism to avoid deadlocks...
To disable this warning, please explicitly set TOKENIZERS_PARALLELISM=(true | false)
Inference:: 0%|| 42/17221 [00:02<14:48, 19.34it/s]
Traceback (most recent call last):
File "train.py", line 215, in
print(trainer.inference(val_data_loader))
File "train.py", line 53, in inference
for i, data in data_iter:
File "/home/ccit19/anaconda3/envs/liuzhe/lib/python3.7/site-packages/tqdm/std.py", line 1129, in iter
for obj in iterable:
File "/home/ccit19/anaconda3/envs/liuz-1.1/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 582, in next
return self._process_next_batch(batch)
File "/home/ccit19/anaconda3/envs/liuz-1.1/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 608, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
RuntimeError: Traceback (most recent call last):
File "/home/ccit19/anaconda3/envs/liuz-1.1/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 99, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/ccit19/anaconda3/envs/liuz-1.1/lib/python3.7/site-packages/torch/utils/data/_utils/collate.py", line 63, in default_collate
return {key: default_collate([d[key] for d in batch]) for key in batch[0]}
File "/home/ccit19/anaconda3/envs/liuz-1.1/lib/python3.7/site-packages/torch/utils/data/_utils/collate.py", line 63, in
return {key: default_collate([d[key] for d in batch]) for key in batch[0]}
File "/home/ccit19/anaconda3/envs/liuz-1.1/lib/python3.7/site-packages/torch/utils/data/_utils/collate.py", line 43, in default_collate
return torch.stack(batch, 0, out=out)
RuntimeError: invalid argument 0: Sizes of tensors must match except in dimension 0. Got 152 and 158 in dimension 1 at /pytorch/aten/src/TH/generic/THTensor.cpp:711

请问有解决方案吗

@s1162276945
Copy link

我最近也遇到了,请问你最后解决了吗

@Dioxideme
Copy link
Author

我最近也遇到了,请问你最后解决了吗

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