代码:
model = BertForSequenceClassification.from_pretrained(model_name+"/bert_config.json") model.to(device)
报错:
OSError: Unable to load weights from pytorch checkpoint file. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True.
代码:
model = BertForSequenceClassification.from_pretrained(model_name+"/bert_config.json") model.to(device)报错:
OSError: Unable to load weights from pytorch checkpoint file. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True.