Comments (4)
It was the bug of OpenCLaP BERT models. I opened an issue at their github repo 4 months ago, but they didn't fix it. You may see the warning when you save the models:
2019-11-05 16:06:53 - train model - INFO - Epoch 2, train Loss: 475.4495771, eval acc: 0.8539215686274509, eval loss: 286.7390137
Saving vocabulary to model/vocab.txt: vocabulary indices are not consecutive. Please check that the vocabulary is not corrupted!
It's caused by some white space lines in vocab.txt
, my code will load the vocab.txt
with no problem, but when I save it to the final model, the vocabulary indexes are broken which leads to bad performance.
You can fix it by copy the original vocab.txt to your final model:
cp OpenCLaP/vocab.txt model/vocab.txt
from cail2019.
I use already learned 民事文书BERT as my pretrained model downloaded from https://github.com/thunlp/OpenCLaP
And I set fp16=False
I train the model with your code. The training is good.
I copy some information from the train.log
But it turns out the acc of the prediction is 0.53 as I run the main.py and judger.py
Does the saving model has some problems?
I have also met the problem that you mentioned, do you solve this ?
from cail2019.
It was the bug of OpenCLaP BERT models. I opened an issue at their github repo 4 months ago, but they didn't fix it. You may see the warning when you save the models:
2019-11-05 16:06:53 - train model - INFO - Epoch 2, train Loss: 475.4495771, eval acc: 0.8539215686274509, eval loss: 286.7390137 Saving vocabulary to model/vocab.txt: vocabulary indices are not consecutive. Please check that the vocabulary is not corrupted!
It's caused by some white space lines in
vocab.txt
, my code will load thevocab.txt
with no problem, but when I save it to the final model, the vocabulary indexes are broken which leads to bad performance.You can fix it by copy the original vocab.txt to your final model:
cp OpenCLaP/vocab.txt model/vocab.txt
It was the bug of OpenCLaP BERT models. I opened an issue at their github repo 4 months ago, but they didn't fix it. You may see the warning when you save the models:
2019-11-05 16:06:53 - train model - INFO - Epoch 2, train Loss: 475.4495771, eval acc: 0.8539215686274509, eval loss: 286.7390137 Saving vocabulary to model/vocab.txt: vocabulary indices are not consecutive. Please check that the vocabulary is not corrupted!
It's caused by some white space lines in
vocab.txt
, my code will load thevocab.txt
with no problem, but when I save it to the final model, the vocabulary indexes are broken which leads to bad performance.You can fix it by copy the original vocab.txt to your final model:
cp OpenCLaP/vocab.txt model/vocab.txt
Can you provide a complete vocab.txt file ? thx!
from cail2019.
Just use the original vocab.txt in the pretrained models. Copy it into output model directory.
from cail2019.
Related Issues (12)
- 软label HOT 2
- 你好,我用你的程序,跑出来,评分只有0.52。感觉差太远了。我只把epoch设成1,batch_size设成8.其它没变。 HOT 30
- 关于Bert模型加载? HOT 11
- 关于模型数据预处理及模型输入的问题? HOT 1
- 数据label问题 HOT 5
- 启发式增广的代码有错误 HOT 1
- 问下官方公开的数据集是第几阶段的啊 HOT 1
- 作者您好!请问我该如何下载pytorch版本的BERT预训练模型呢?不胜感激! HOT 2
- 使用数据增广后报错 HOT 2
- from apex import FP16 rasied errors HOT 6
- 5fold and 1fold experiment GAP HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cail2019.