Open bing0037 opened 3 years ago
Hi @bing0037 I haven't run this code in a while but it used to work. My first guess would be probably an incompatibility with a newer version of pytorch. Can you try again in an environment with pytorch 1.0 or 1.1?
If that doesn't solve it then I'm not too sure... I wasn't using DataParallel in the code so I'm not sure why it would show up in the eror message... let me know how changing the pytorch version goes.
I met the same problem today and solved it by adding the following code block in _pytorch-pretrained-BERT/examples/runclassifier.py
# around line 260
model = torch.nn.DataParallel(model)
+ model = model.module
Hope it helps.
Reference:
Hi @caidongqi I tried changing the run_classifier.py file as you have done. But ran into the same errors as @bing0037. I was also trying to reproduce the result for BERT. I am using Python 3.8 and PyTorch 1.8.0
1(standard_in) 2: syntax error
0.00000(standard_in) 2: syntax error
0.00000(standard_in) 2: syntax error
0.00000(standard_in) 2: syntax error
0.00000(standard_in) 2: syntax error
0.00000(standard_in) 2: syntax error
Any ideas or solutions to this?
Hi,
I am trying to reproduce your result of BERT. I followed the Prerequisite:
But got this error:
Any idea or suggestion?