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

请问为什么在训练完成后无法启动预测 #925

Open
bailiancg opened this issue Jan 19, 2025 · 0 comments
Open

请问为什么在训练完成后无法启动预测 #925

bailiancg opened this issue Jan 19, 2025 · 0 comments

Comments

@bailiancg
Copy link

在训练完成后我使用命令:python run_infer.py --param_path ./examples/cls_ernie_fc_ch_infer.json来启动预测,
但是报错缺失了文件
[Errno 2] No such file or directory: './output/cls_ernie_3.0_base_fc_ch_dy/save_checkpoints/checkpoints_step_200\infer_data_params.json'
但是在训练过程中我并没有生成这个json文件。

完整报错:
INFO: 01-19 14:36:45: params.py:43 * 13200 ./output/cls_ernie_3.0_base_fc_ch_dy/save_checkpoints/checkpoints_step_200\infer_data_params.json
Traceback (most recent call last):
File "C:\Users\Zhang\Desktop\attend\ERNIE-ernie-kit-open-v1.0\ERNIE-ernie-kit-open-v1.0\applications\tasks\text_classification\run_infer.py", line 71, in
inference = build_inference(inference_params_dict, dataset_reader, parse_predict_result)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Zhang\Desktop\attend\ERNIE-ernie-kit-open-v1.0\ERNIE-ernie-kit-open-v1.0\applications\tasks\text_classification\run_infer.py", line 30, in build_inference
inference = inference_class(params=params_dict, data_set_reader=dataset_reader, parser_handler=parser_handler)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Zhang\Desktop\attend\ERNIE-ernie-kit-open-v1.0\ERNIE-ernie-kit-open-v1.0\applications\tasks\text_classification\inference\custom_inference.py", line 24, in init
BaseInference.init(self, params, data_set_reader, parser_handler)
File "C:\Users\Zhang\Desktop\attend\ERNIE-ernie-kit-open-v1.0\ERNIE-ernie-kit-open-v1.0\applications\tasks\text_classification../../..\erniekit\controller\inference.py", line 38, in init
self.parser_input_keys()
File "C:\Users\Zhang\Desktop\attend\ERNIE-ernie-kit-open-v1.0\ERNIE-ernie-kit-open-v1.0\applications\tasks\text_classification../../..\erniekit\controller\inference.py", line 106, in parser_input_keys
param_dict = params.from_file(data_params_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Zhang\Desktop\attend\ERNIE-ernie-kit-open-v1.0\ERNIE-ernie-kit-open-v1.0\applications\tasks\text_classification../../..\erniekit\utils\params.py", line 50, in from_file
json_file = json.loads(evaluate_file(filename), strict=False)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Zhang\Desktop\attend\ERNIE-ernie-kit-open-v1.0\ERNIE-ernie-kit-open-v1.0\applications\tasks\text_classification../../..\erniekit\utils\params.py", line 44, in evaluate_file
with open(filename, "r") as evaluation_file:
^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: './output/cls_ernie_3.0_base_fc_ch_dy/save_checkpoints/checkpoints_step_200\infer_data_params.json'

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

No branches or pull requests

1 participant