ernie_v2_eng_large模型文档错误
Created by: barrierye
1)PaddleHub和PaddlePaddle版本:paddlehub==1.6.1,paddlepaddle==1.7.1 2)系统环境:docker镜像 nvidia/cuda:9.0-cudnn7-runtime-centos7,Python 2.7.5
根据ernie_v2_eng_large模型文档跑示例代码,报错如下:
[root@1cab43374dfd ~]# cat test.py
import paddlehub as hub
# Load ernie pretrained model
module = hub.Module(name="ernie_v2_eng_large")
inputs, outputs, program = module.context(trainable=True, max_seq_len=128)
# Must feed all the following tensor of ernie's module need
input_ids = inputs["input_ids"]
position_ids = inputs["position_ids"]
segment_ids = inputs["segment_ids"]
input_mask = inputs["input_mask"]
# task_ids is not necessary during finetuning
task_ids = inputs["task_ids"]
[root@1cab43374dfd ~]# python test.py
[2020-03-30 13:06:57,414] [ INFO] - Installing ernie_v2_eng_large module
[2020-03-30 13:06:57,453] [ INFO] - Module ernie_v2_eng_large already installed in /root/.paddlehub/modules/ernie_v2_eng_large
[2020-03-30 13:07:09,317] [ INFO] - Load pretraining parameters from /root/.paddlehub/modules/ernie_v2_eng_large/assets/params.
Traceback (most recent call last):
File "test.py", line 13, in <module>
task_ids = inputs["task_ids"]
KeyError: 'task_ids'