arthurrizar / tensorflow_ernie Goto Github PK
View Code? Open in Web Editor NEW将百度ernie的paddlepaddle模型转成tensorflow模型
将百度ernie的paddlepaddle模型转成tensorflow模型
我想将ernie模型转化成像bert那样的tf模型
用你的代码如下会报错(没有如下的引用)
from model.ernie import ErnieConfig
from utils.init import init_checkpoint, init_pretraining_params
from finetune.classifier import create_model
使用最新的ernie版本,运行出错,错误如下:
Traceback (most recent call last):
File "pad_to_np.py", line 54, in
ernie_config=ernie_config)
File "/home/xx/ERNIE/finetune/classifier.py", line 69, in create_model
qids) = fluid.layers.read_file(pyreader)
UnboundLocalError: local variable 'pyreader' referenced before assignment
是ernie的问题吗?
其实这不是什么问题,就是我的困惑。
bert原版权重中bert_model.ckpt.data-00000-of-00001是300多m,bert_model.ckpt.meta不到1m;大佬你转的版本中bert_model.ckpt.data-00000-of-00001也是300多m,但是bert_model.ckpt.meta也有300多m。那么bert_model.ckpt.meta里边多存了什么东西呢?
我的微信是15069061988
你好~tf2.0弃用了session这个概念,你的项目中np_to_tf代码已无法在tf2.0版本中执行。我在网上检索了一番,发现包括官方文档在内的几乎所有资料都是使用checkpoint以模型为单位进行预训练变量的存储及载入的。这里的情景是没有网络结构仅保存预训练参数。请问应该如何实现呢?你有计划更新代码么?
可以开源将paddlepaddle转为tensorflow的脚本吗
作者您好,这个模型的调用需要对数据进行与bert模型不同的预处理吗,mask这部分需要必须对词进行mask吗,用于分类或者阅读理解等任务
大佬能不能把requirements.txt补充一下?
你好,我试图用keras_bert的load_trained_model_from_checkpoint加载你转的ernie权重,出现:
tensorflow.python.framework.errors_impl.NotFoundError: Key bert/encoder/layer_0/output/dense/bias not found in checkpoint
加载官方提供的chinese_L-12_H-768_A-12权重是正常的。
不知道有什么解决方法或者建议吗?
keras_bert:https://github.com/CyberZHG/keras-bert
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.