ersatz icon indicating copy to clipboard operation
ersatz copied to clipboard

RuntimeError: cannot reshape tensor

Open robotsp opened this issue 2 years ago • 1 comments

@rewicks @mjpost Dear contributor,

I came across an error when I train the model,

Traceback (most recent call last): File "trainer.py", line 419, in main() File "trainer.py", line 93, in main determiner=determiner) File "trainer.py", line 342, in run_epoch for i, (contexts, factors, labels, context_strings) in enumerate(self.training_set.batchify(batch_size)): File "/opt/yansongpeng/Mirli_Bert/Mirli_Bert/ersatz/dataset.py", line 214, in batchify context = context.view(len(data), -1) RuntimeError: cannot reshape tensor of 0 elements into shape [0, -1] because the unspecified dimension size -1 can be any value and is ambiguous

My training set is, ▁to ▁help ▁us ▁understand ▁what ▁has ▁been ▁happen ing . ||| ▁A t ▁the ▁start ▁of ▁the ▁crisis , ▁many ▁people |||

Would you please give me a hand? Thanks!

robotsp avatar Feb 11 '22 05:02 robotsp