解决Bert 报错:AttributeError: ‘str’ object has no attribute ‘softmax’
需要将这里改为:
output= self.bert(input_ids = batch_seqs, attention_mask = batch_seq_masks,token_type_ids=batch_seq_segments, labels = labels)
loss = output.loss
logits = output.logits
解决Bert 报错:AttributeError: ‘str’ object has no attribute ‘softmax’
需要将这里改为:
output= self.bert(input_ids = batch_seqs, attention_mask = batch_seq_masks,token_type_ids=batch_seq_segments, labels = labels)
loss = output.loss
logits = output.logits