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