Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自己训练的模型,部署的时候,如何知道输入参数是什么? #799

Closed
fisher030712 opened this issue Aug 16, 2020 · 1 comment
Assignees

Comments

@fisher030712
Copy link

看了PaddleServing的例子,按例子作,很简单。但是部署我自己训练的模型,却不知该如何下手。主要的问题是,我不知道模型的输入参数是什么,客户端调用的时候,该如何给参数?
我是基于PaddleHub作的ERNIE的finetue,作文本分类和序列标注。从训练脚本上面看,也看不出模型的输入参数是什么。难道这个东西是固定的吗?该如何确定模型的输入参数和形式呢?谢谢!

训练脚本如下,实在是不知道该如何调用:

注意,Reader、Task、context参数中的max_seq_len应该保持一致

reader = hub.reader.SequenceLabelReader(
dataset = dataset,
vocab_path = module.get_vocab_path(),
max_seq_len = max_seq_len)

strategy = hub.AdamWeightDecayStrategy(
weight_decay = 0.01,
learning_rate = 5e-5,
warmup_proportion = 0.1)

config = hub.RunConfig(
use_cuda = use_cuda,
num_epoch = num_epoch,
batch_size = batch_size,
checkpoint_dir = checkpoint_dir,
eval_interval = 50,
strategy = strategy)

task = hub.SequenceLabelTask(
data_reader = reader,
feature = sequence_output,
feed_list = feed_list,
add_crf = True,
max_seq_len = max_seq_len,
num_classes = dataset.num_labels,
config = config)

@github-actions
Copy link

Message that will be displayed on users' first issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants