model = build_transformer_model(config_path, checkpoint_path, model=’roberta’)
输出
tensorflow.python.framework.errors_impl.DataLossError: Unable to open table file /home/tguser/lz/pretrainModels/torch/eng/roberta_large/tf_model.h5: Data loss: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?
提问时请尽可能提供如下信息:
基本信息
核心代码
输出
tensorflow.python.framework.errors_impl.DataLossError: Unable to open table file /home/tguser/lz/pretrainModels/torch/eng/roberta_large/tf_model.h5: Data loss: not an sstable (bad magic number): perhaps your file is in a different file format and you need to use a different restore operator?
自我尝试
尝试将huggingface robertalarge 模型tf_model.h5作为checkpoint加载,把vocab.json转为txt形式加载tokenizer
但是报错信息,loadcheckpoint似乎不能够加载h5
如果想要使用roberta-large英文的模型要如何加载呢 https://github.com/pytorch/fairseq/blob/main/examples/roberta/README.md