cdqa-suite / cdQA

⛔ [NOT MAINTAINED] An End-To-End Closed Domain Question Answering System.
https://cdqa-suite.github.io/cdQA-website/
Apache License 2.0
616 stars 191 forks source link

AttributeError: 'tuple' object has no attribute 'backward' #309

Closed woongyver closed 4 years ago

woongyver commented 4 years ago

Hi, Thank you for my inspiration for the BERT QA. I'm trying custom training at # 307. The following error occurs when the "reader.fit (X = (train_examples, train_features))" statement is executed.

/cdqa/reader/bertqa_sklearn.py in fit(self, X, y) 1394 optimizer.backward(loss) 1395 else: -> 1396 loss.backward() 1397 if (step + 1) % self.gradient_accumulation_steps == 0: 1398 if self.fp16:

AttributeError: 'tuple' object has no attribute 'backward'

andrelmfarias commented 4 years ago

Hi,

I just merged the branch with the fix for the training.

Could you please try with the latest version of cdQA?

Thanks!

woongyver commented 4 years ago

Hi,

I just merged the branch with the fix for the training.

Could you please try with the latest version of cdQA?

Thanks!

Pytorch has problems when installing with "torch> = 1.2.0" listed in "requirements.txt". Installing Pytorch separately solved the problem.

Thanks a lot for fast replying.