未验证 提交 cd2f8f9e 编写于 作者: C Chengmo 提交者: GitHub

Fix infer (#98)

* fix esmm

* single infer -> infer

* fix increment folder repeated
Co-authored-by: Ntangwei <tangwei12@baidu.com>
上级 88600d7d
......@@ -86,7 +86,7 @@ python -m paddlerec.run -m ./config.yaml # 自定义修改超参后,指定配
# 修改对应模型的config.yaml, workspace配置为当前目录的绝对路径
# 修改对应模型的config.yaml,mode配置infer_runner
# 示例: mode: train_runner -> mode: infer_runner
# infer_runner中 class配置为 class: single_infer
# infer_runner中 class配置为 class: infer
# 修改phase阶段为infer的配置,参照config注释
# 修改完config.yaml后 执行:
......@@ -106,7 +106,7 @@ python -m paddlerec.run -m ./config.yaml # 自定义修改超参后,指定配
# 修改对应模型的config.yaml, workspace配置为当前目录的绝对路径
# 修改对应模型的config.yaml,mode配置infer_runner
# 示例: mode: train_runner -> mode: infer_runner
# infer_runner中 class配置为 class: single_infer
# infer_runner中 class配置为 class: infer
# 修改phase阶段为infer的配置,参照config注释
# 修改完config.yaml后 执行:
......
......@@ -64,8 +64,7 @@ runner:
device: cpu
- name: runner_infer
epochs: 1
class: single_infer
class: infer
print_interval: 10000
init_model_path: "increment/9" # load model path
......
......@@ -64,8 +64,7 @@ runner:
device: cpu
- name: runner_infer
epochs: 1
class: single_infer
class: infer
print_interval: 10000
init_model_path: "increment/9" # load model path
......
......@@ -56,9 +56,7 @@ runner:
init_model_path: "" # load model path
print_interval: 2
- name: infer_runner
class: single_infer
# num of epochs
epochs: 1
class: infer
# device to run training or infer
device: cpu
print_interval: 1
......
......@@ -63,9 +63,7 @@ runner:
init_model_path: "" # load model path
print_interval: 1
- name: infer_runner
class: single_infer
# num of epochs
epochs: 1
class: infer
# device to run training or infer
device: cpu
print_interval: 1
......
......@@ -43,7 +43,7 @@ python -m paddlerec.run -m paddlerec.models.match.multiview-simnet # multiview-s
# 修改对应模型的config.yaml, workspace配置为当前目录的绝对路径
# 修改对应模型的config.yaml,mode配置infer_runner
# 示例: mode: train_runner -> mode: infer_runner
# infer_runner中 class配置为 class: single_infer
# infer_runner中 class配置为 class: infer
# 修改phase阶段为infer的配置,参照config注释
# 修改完config.yaml后 执行:
......
......@@ -16,21 +16,21 @@
workspace: "paddlerec.models.multitask.esmm"
dataset:
- name: dataset_train
batch_size: 1
type: QueueDataset
data_path: "{workspace}/data/train"
data_converter: "{workspace}/esmm_reader.py"
- name: dataset_infer
batch_size: 1
type: QueueDataset
data_path: "{workspace}/data/test"
data_converter: "{workspace}/esmm_reader.py"
- name: dataset_train
batch_size: 1
type: QueueDataset
data_path: "{workspace}/data/train"
data_converter: "{workspace}/esmm_reader.py"
- name: dataset_infer
batch_size: 1
type: QueueDataset
data_path: "{workspace}/data/test"
data_converter: "{workspace}/esmm_reader.py"
hyper_parameters:
vocab_size: 10000
embed_size: 128
optimizer:
optimizer:
class: adam
learning_rate: 0.001
strategy: async
......@@ -39,30 +39,29 @@ hyper_parameters:
mode: [train_runner, infer_runner]
runner:
- name: train_runner
class: train
device: cpu
epochs: 3
save_checkpoint_interval: 2
save_inference_interval: 4
save_checkpoint_path: "increment"
save_inference_path: "inference"
print_interval: 10
phases: [train]
- name: infer_runner
class: infer
init_model_path: "increment/0"
device: cpu
epochs: 1
print_interval: 1
phases: [infer]
- name: train_runner
class: train
device: cpu
epochs: 3
save_checkpoint_interval: 2
save_inference_interval: 4
save_checkpoint_path: "increment"
save_inference_path: "inference"
print_interval: 10
phases: [train]
- name: infer_runner
class: infer
init_model_path: "increment/1"
device: cpu
print_interval: 1
phases: [infer]
phase:
- name: train
model: "{workspace}/model.py"
dataset_name: dataset_train
thread_num: 1
- name: infer
model: "{workspace}/model.py"
dataset_name: dataset_infer
thread_num: 1
- name: train
model: "{workspace}/model.py"
dataset_name: dataset_train
thread_num: 1
- name: infer
model: "{workspace}/model.py"
dataset_name: dataset_infer
thread_num: 1
......@@ -52,10 +52,9 @@ runner:
save_inference_path: "inference"
print_interval: 10
- name: infer_runner
class: single_infer
class: infer
init_model_path: "increment/0"
device: cpu
epochs: 3
phase:
- name: train
......
......@@ -77,7 +77,7 @@ python -m paddlerec.run -m ./config.yaml # 自定义修改超参后,指定配
# 修改对应模型的config.yaml, workspace配置为当前目录的绝对路径
# 修改对应模型的config.yaml,mode配置infer_runner
# 示例: mode: train_runner -> mode: infer_runner
# infer_runner中 class配置为 class: single_infer
# infer_runner中 class配置为 class: infer
# 修改phase阶段为infer的配置,参照config注释
# 修改完config.yaml后 执行:
......
......@@ -51,10 +51,9 @@ runner:
save_inference_path: "inference"
print_interval: 5
- name: infer_runner
class: single_infer
class: infer
init_model_path: "increment/0"
device: cpu
epochs: 3
phase:
- name: train
......
......@@ -59,8 +59,7 @@ runner:
save_inference_path: "inference"
print_interval: 1
- name: infer_runner
class: single_infer
epochs: 1
class: infer
device: cpu
init_model_path: "increment/0"
print_interval: 1
......
......@@ -60,7 +60,7 @@ runner:
save_inference_path: "inference"
print_interval: 1
- name: infer_runner
class: single_infer
class: infer
epochs: 1
device: cpu
init_model_path: "increment/0"
......
......@@ -58,8 +58,7 @@ runner:
save_inference_path: "inference"
print_interval: 1
- name: infer_runner
class: single_infer
epochs: 1
class: infer
device: cpu
init_model_path: "increment/0"
print_interval: 1
......
......@@ -58,8 +58,7 @@ runner:
save_inference_path: "inference"
print_interval: 1
- name: infer_runner
class: single_infer
epochs: 1
class: infer
device: cpu
init_model_path: "increment/0"
print_interval: 1
......
......@@ -56,8 +56,7 @@ runner:
save_inference_path: "inference"
print_interval: 1
- name: infer_runner
class: single_infer
epochs: 1
class: infer
device: cpu
init_model_path: "increment/0"
print_interval: 1
......
......@@ -57,8 +57,7 @@ runner:
save_inference_path: "inference"
print_interval: 1
- name: infer_runner
class: single_infer
epochs: 1
class: infer
device: cpu
init_model_path: "increment/0"
print_interval: 1
......
......@@ -62,8 +62,7 @@ runner:
save_inference_path: "inference"
print_interval: 1
- name: infer_runner
class: single_infer
epochs: 1
class: infer
device: cpu
init_model_path: "increment/0"
print_interval: 1
......
......@@ -57,8 +57,7 @@ runner:
save_inference_path: "inference"
print_interval: 1
- name: infer_runner
class: single_infer
epochs: 1
class: infer
device: cpu
init_model_path: "increment/0"
print_interval: 1
......
......@@ -68,8 +68,7 @@ runner:
save_inference_path: "inference_fnn"
print_interval: 1
- name: infer_runner
trainer_class: single_infer
epochs: 1
trainer_class: infer
device: cpu
init_model_path: "increment/0"
print_interval: 1
......
......@@ -56,8 +56,7 @@ runner:
save_inference_path: "inference"
print_interval: 1
- name: infer_runner
class: single_infer
epochs: 1
class: infer
device: cpu
init_model_path: "increment/0"
print_interval: 1
......
......@@ -63,8 +63,7 @@ runner:
save_inference_path: "inference"
print_interval: 1
- name: infer_runner
class: single_infer
epochs: 1
class: infer
device: cpu
init_model_path: "increment/0"
print_interval: 1
......
......@@ -60,8 +60,7 @@ runner:
save_inference_path: "inference"
print_interval: 1
- name: infer_runner
class: single_infer
epochs: 1
class: infer
device: cpu
init_model_path: "increment/0"
print_interval: 1
......
......@@ -98,7 +98,7 @@ python -m paddlerec.run -m ./config.yaml
```
# 修改对应模型的config.yaml,mode配置infer_runner
# 示例: mode: runner1 -> mode: infer_runner
# infer_runner中 class配置为 class: single_infer
# infer_runner中 class配置为 class: infer
# 如果训练阶段和预测阶段的模型输入一致,phase不需要改动,复用train的即可
# 修改完config.yaml后 执行:
......
......@@ -54,8 +54,7 @@ runner:
save_checkpoint_path: "increment"
save_inference_path: "inference"
- name: infer_runner
class: single_infer
epochs: 1
class: infer
device: cpu
init_model_path: "increment/0"
......
......@@ -55,8 +55,7 @@ runner:
save_checkpoint_path: "increment"
save_inference_path: "inference"
- name: infer_runner
class: single_infer
epochs: 1
class: infer
device: cpu
init_model_path: "increment/0"
......
......@@ -61,9 +61,7 @@ runner:
init_model_path: "" # load model path
print_interval: 1
- name: infer_runner
class: single_infer
# num of epochs
epochs: 1
class: infer
# device to run training or infer
device: cpu
print_interval: 1
......
......@@ -54,10 +54,9 @@ runner:
save_inference_path: "inference"
print_interval: 10
- name: infer_runner
class: single_infer
class: infer
init_model_path: "increment/0"
device: cpu
epochs: 1
phase:
- name: train
......
......@@ -51,10 +51,9 @@ runner:
save_inference_path: "inference"
print_interval: 10
- name: infer_runner
class: single_infer
class: infer
init_model_path: "increment/0"
device: cpu
epochs: 1
phase:
- name: train
......
......@@ -95,7 +95,7 @@ python -m paddlerec.run -m ./config.yaml # 自定义修改超参后,指定配
# 修改对应模型的config.yaml, workspace配置为当前目录的绝对路径
# 修改对应模型的config.yaml,mode配置infer_runner
# 示例: mode: train_runner -> mode: infer_runner
# infer_runner中 class配置为 class: single_infer
# infer_runner中 class配置为 class: infer
# 修改phase阶段为infer的配置,参照config注释
# 修改完config.yaml后 执行:
......
......@@ -50,10 +50,9 @@ runner:
save_inference_path: "inference"
print_interval: 10
- name: infer_runner
class: single_infer
class: infer
init_model_path: "increment/0"
device: cpu
epochs: 1
phase:
- name: train
......
......@@ -61,9 +61,7 @@ runner:
init_model_path: "" # load model path
print_interval: 1
- name: infer_runner
class: single_infer
# num of epochs
epochs: 1
class: infer
# device to run training or infer
device: cpu
init_model_path: "increment/0" # load model path
......
......@@ -51,10 +51,9 @@ runner:
save_checkpoint_path: "increment"
save_inference_path: "inference"
- name: infer_runner
class: single_infer
class: infer
init_model_path: "increment/0"
device: cpu
epochs: 3
phase:
- name: train
......
......@@ -80,10 +80,8 @@ runner:
print_interval: 10
- name: runner2
class: single_infer
class: infer
startup_class_path: "{workspace}/tdm_startup.py"
# num of epochs
epochs: 1
# device to run training or infer
device: cpu
init_model_path: "increment/0" # load model path
......
......@@ -49,7 +49,7 @@ function model_test() {
root_dir=`pwd`
all_model=$(find ${root_dir} -name config.yaml)
special_models=("demo" "pnn" "fgcnn" "esmm")
special_models=("demo" "pnn" "fgcnn" "gru4rec" "tagspace")
for model in ${all_model}
do
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册