I am trying to create an instance of the BertForSequenceClassification model for multilabel text classification with the following code
model = BertForSequenceClassification.from_pretrained(path+'\config.json',
num_labels=len(label_dict),
output_attentions=False,
output_hidden_states=False,
)
I have saved the BERT base uncased files locally, but I am getting this error
File "h5py\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5pyh5f.pyx", line 88, in h5py.h5f.open
OSError: Unable to open file (file signature not found)
Any suggestions on how to work around this issue?
question from:
https://stackoverflow.com/questions/65886408/unable-to-open-file-file-signature-not-found-when-loading-bert-sequence-clas 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…