thunlp / QuoteR

Official code and data of the ACL 2022 paper "QuoteR: A Benchmark of Quote Recommendation for Writing"
60 stars 11 forks source link

感觉有个bug #3

Open 2018302345 opened 2 years ago

2018302345 commented 2 years ago

Traceback (most recent call last): File "ancient_chinese_train_test.py", line 546, in training_mask(model=model, epoch=40, train=train_loader, valid=valid_loader, quote_tensor=qudings, device=device) File "ancient_chinese_train_test.py", line 490, in training_mask labels = labels.to(device, dtype=torch.long) AttributeError: 'tuple' object has no attribute 'to'

training mask里面的labels是直接返回的quote,没有经过编码。

flutter69 commented 2 years ago

Traceback (most recent call last): File "ancient_chinese_train_test.py", line 546, in training_mask(model=model, epoch=40, train=train_loader, valid=valid_loader, quote_tensor=qudings, device=device) File "ancient_chinese_train_test.py", line 490, in training_mask labels = labels.to(device, dtype=torch.long) AttributeError: 'tuple' object has no attribute 'to'

training mask里面的labels是直接返回的quote,没有经过编码。

代码有些问题,已经修改好了,请再运行一下