提交 dc437431 编写于 作者: 0 0YuanZhang0

add_predict_and_eval

上级 beb2cd14
...@@ -91,7 +91,7 @@ export CUDA_VISIBLE_DEVICES=0,1,2,3 ...@@ -91,7 +91,7 @@ export CUDA_VISIBLE_DEVICES=0,1,2,3
python -m paddle.distributed.launch --selected_gpus=0,1,2,3 train.py \ python -m paddle.distributed.launch --selected_gpus=0,1,2,3 train.py \
--train_file ./data/train.tsv \ --train_file ./data/train.tsv \
--test_file ./data/test.tsv \ --test_file ./data/test.tsv \
--word_dict_path ./conf/word.dic \ --word_dict_path ./conf/word.dic \
--label_dict_path ./conf/tag.dic \ --label_dict_path ./conf/tag.dic \
--word_rep_dict_path ./conf/q2b.dic \ --word_rep_dict_path ./conf/q2b.dic \
...@@ -111,7 +111,7 @@ CPU上训练 ...@@ -111,7 +111,7 @@ CPU上训练
``` ```
python -u train.py \ python -u train.py \
--train_file ./data/train.tsv \ --train_file ./data/train.tsv \
--test_file ./data/test.tsv \ --test_file ./data/test.tsv \
--word_dict_path ./conf/word.dic \ --word_dict_path ./conf/word.dic \
--label_dict_path ./conf/tag.dic \ --label_dict_path ./conf/tag.dic \
--word_rep_dict_path ./conf/q2b.dic \ --word_rep_dict_path ./conf/q2b.dic \
...@@ -132,16 +132,16 @@ python -u train.py \ ...@@ -132,16 +132,16 @@ python -u train.py \
加载已有的模型,对未知的数据进行预测 加载已有的模型,对未知的数据进行预测
```bash ```bash
python predict.py \ python predict.py \
--predict_file ./data/infer.tsv \ --predict_file ./data/infer.tsv \
--word_dict_path ./conf/word.dic \ --word_dict_path ./conf/word.dic \
--label_dict_path ./conf/tag.dic \ --label_dict_path ./conf/tag.dic \
--word_rep_dict_path ./conf/q2b.dic \ --word_rep_dict_path ./conf/q2b.dic \
--init_from_checkpoint model_baseline/params \ --init_from_checkpoint model_baseline/params \
--output_file predict.result \ --output_file predict.result \
--mode predict \ --mode predict \
--device gpu \ --device gpu \
-d -d
# -d: 是否使用动态图模式进行训练,如果使用静态图训练,命令行请删除-d参数 # -d: 是否使用动态图模式进行训练,如果使用静态图训练,命令行请删除-d参数
``` ```
...@@ -153,12 +153,12 @@ python predict.py \ ...@@ -153,12 +153,12 @@ python predict.py \
# baseline model # baseline model
python eval.py \ python eval.py \
--test_file ./data/test.tsv \ --test_file ./data/test.tsv \
--word_dict_path ./conf/word.dic \ --word_dict_path ./conf/word.dic \
--label_dict_path ./conf/tag.dic \ --label_dict_path ./conf/tag.dic \
--word_rep_dict_path ./conf/q2b.dic \ --word_rep_dict_path ./conf/q2b.dic \
--init_from_checkpoint ./model_baseline/params \ --init_from_checkpoint ./model_baseline/params \
--device gpu \ --device gpu \
-d -d
# -d: 是否使用动态图模式进行训练,如果使用静态图训练,命令行请删除-d参数 # -d: 是否使用动态图模式进行训练,如果使用静态图训练,命令行请删除-d参数
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册