From 476c51a73c1fda0ae562addecb7c9ad366c0cb04 Mon Sep 17 00:00:00 2001 From: tink2123 Date: Sun, 10 May 2020 09:18:27 +0000 Subject: [PATCH] mv dataset in config --- configs/rec/rec_chinese_lite_train.yml | 1 - set_env.sh | 12 ++++++++++++ tools/eval.py | 5 ++--- 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 set_env.sh diff --git a/configs/rec/rec_chinese_lite_train.yml b/configs/rec/rec_chinese_lite_train.yml index 29506ff4..e821a623 100755 --- a/configs/rec/rec_chinese_lite_train.yml +++ b/configs/rec/rec_chinese_lite_train.yml @@ -1,6 +1,5 @@ Global: algorithm: CRNN - dataset: common use_gpu: true epoch_num: 300 log_smooth_window: 20 diff --git a/set_env.sh b/set_env.sh new file mode 100644 index 00000000..b32e58e3 --- /dev/null +++ b/set_env.sh @@ -0,0 +1,12 @@ +#. /paddle/set_env.sh↩ +export CUDA_VISIBLE_DEVICES="0,1,2,3"↩ +export PYTHONPATH=$PYTHONPATH:.↩ +export FLAGS_fraction_of_gpu_memory_to_use=1.0↩ +↩ +python_bin_dir="/opt/_internal/cpython-3.7.0/bin/"↩ +alias python=$python_bin_dir"python3.7"↩ +alias pip=$python_bin_dir"pip3.7"↩ +alias ipython=$python_bin_dir"ipython3"↩ +export LD_LIBRARY_PATH=/opt/_internal/cpython-3.7.0/lib:$LD_LIBRARY_PATH↩ +export PYTHONPATH=$PYTHONPATH:.↩ +ldconfig↩ diff --git a/tools/eval.py b/tools/eval.py index 14840f72..3b176648 100755 --- a/tools/eval.py +++ b/tools/eval.py @@ -79,9 +79,8 @@ def main(): 'fetch_varname_list':eval_fetch_varname_list} metrics = eval_det_run(exe, config, eval_info_dict, "test") else: - dataset = config['Global']['dataset'] - assert dataset in ['lmdb', 'common'] - if dataset == 'common': + reader_type = config['Global']['reader_yml'] + if "chinese" in reader_type: eval_reader = reader_main(config=config, mode="eval") eval_info_dict = {'program': eval_program, \ 'reader': eval_reader, \