PaddlePaddle / Knover

Large-scale open domain KNOwledge grounded conVERsation system based on PaddlePaddle
Apache License 2.0
674 stars 131 forks source link

An PLATO-2 inference error for data pre-process??? #46

Closed nanzhao closed 3 years ago

nanzhao commented 3 years ago

I try to use plato to infer a example data with the instrunction of https://github.com/PaddlePaddle/Knover/tree/develop/projects/PLATO-2.

But I encounter an error below. And my code branch is develop and paddle is 2.0.1.

could you give me some help for this issue?

aistudio@jupyter-208728-1765888:~/develop/Knover$ git branch

INFO 2021-04-14 12:08:40,193 launch_utils.py:475] details abouts PADDLE_TRAINER_ENDPOINTS can be found in ./log/endpoints.log, and detail running logs maybe found in ./log/workerlog.0 /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/setuptools/depends.py:2: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses import imp { "is_distributed": true, "save_path": "./output", "infer_file": "./data/dailydialog_test_60.tsv", "output_name": "response", "log_steps": 1, "Model": { "model": "Plato", "config_path": "./projects/PLATO-2/24L.json", "init_checkpoint": "", "init_pretraining_params": "./24L/Plato", "optimizer": "AdamW", "learning_rate": 1e-05, "warmup_steps": 0, "lr_scheduler": "noam", "max_training_steps": 2000, "min_learning_rate": 0, "weight_decay": 0.0, "max_grad_norm": 0.1, "use_recompute": false, "use_amp": false, "amp_loss_scaling": 32768.0, "weight_sharing": true, "mem_efficient": false, "use_role": false, "use_bow": true, "use_entropy": false, "pre_encoder_cmd": "d", "preprocess_cmd": "n", "postprocess_cmd": "da", "post_cls_cmd": "n", "cls_bias": true, "attention_probs_dropout_prob": 0.1, "hidden_act": "gelu", "hidden_dropout_prob": 0.1, "hidden_size": 1024, "initializer_range": 0.02, "max_position_embeddings": 256, "latent_type_size": 20, "num_attention_heads": 16, "num_hidden_layers": 24, "type_vocab_size": 2, "vocab_size": 8001 }, "Generator": { "min_dec_len": 1, "max_dec_len": 64, "decoding_strategy": "topk_sampling", "temperature": 1.0, "ignore_unk": true, "num_samples": null, "topk": 10, "topp": 0.9, "beam_size": 10, "length_average": true, "length_penalty": 0.0 }, "Task": { "task": "DialogGeneration", "do_generation": true, "is_cn": false, "filter_cross_repetition": true, "nsp_inference_model_path": "./24L/NSP", "ranking_score": "nsp_score" }, "Reader": { "max_src_len": 128, "max_tgt_len": 128, "max_seq_len": 256, "max_knowledge_len": 0, "knowledge_position": "post_src", "knowledge_style": "original", "truncate_first_turn": false, "file_format": "file", "data_format": "raw", "in_tokens": false, "batch_size": 5, "position_style": "continuous", "random_seed": 11, "shuffle_pool_size": 0, "sort_pool_size": 65536 }, "Tokenizer": { "tokenizer": "SentencePieceTokenizer", "vocab_path": "./package/dialog_en/vocab.txt", "specials_path": "", "do_lower_case": false, "spm_model_file": "./package/dialog_en/spm.model" }, "run_infer": true } W0414 12:08:41.338814 1234 device_context.cc:362] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 11.0, Runtime API Version: 10.1 W0414 12:08:41.343097 1234 device_context.cc:372] device: 0, cuDNN Version: 7.6. /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:298: UserWarning: /home/aistudio/develop/Knover/knover/models/unified_transformer.py:140 The behavior of expression A + B has been unified with elementwise_add(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_add(X, Y, axis=0) instead of A + B. This transitional warning will be dropped in the future. op_type, op_type, EXPRESSION_MAP[method_name])) /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:298: UserWarning: /home/aistudio/develop/Knover/knover/modules/transformer_block.py:113 The behavior of expression A + B has been unified with elementwise_add(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_add(X, Y, axis=0) instead of A + B. This transitional warning will be dropped in the future. op_type, op_type, EXPRESSION_MAP[method_name])) /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:298: UserWarning: /home/aistudio/develop/Knover/knover/modules/transformer_block.py:213 The behavior of expression A + B has been unified with elementwise_add(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_add(X, Y, axis=0) instead of A + B. This transitional warning will be dropped in the future. op_type, op_type, EXPRESSION_MAP[method_name])) /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/utils.py:77: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working return (isinstance(seq, collections.Sequence) and /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:298: UserWarning: /home/aistudio/develop/Knover/knover/modules/generator.py:225 The behavior of expression A B has been unified with elementwise_mul(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_mul(X, Y, axis=0) instead of A B. This transitional warning will be dropped in the future. op_type, op_type, EXPRESSION_MAP[method_name])) /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:298: UserWarning: /home/aistudio/develop/Knover/knover/modules/generator.py:225 The behavior of expression A / B has been unified with elementwise_div(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_div(X, Y, axis=0) instead of A / B. This transitional warning will be dropped in the future. op_type, op_type, EXPRESSION_MAP[method_name])) /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:298: UserWarning: /home/aistudio/develop/Knover/knover/modules/generator.py:255 The behavior of expression A B has been unified with elementwise_mul(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_mul(X, Y, axis=0) instead of A B. This transitional warning will be dropped in the future. op_type, op_type, EXPRESSION_MAP[method_name])) /opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:298: UserWarning: /home/aistudio/develop/Knover/knover/modules/generator.py:255 The behavior of expression A - B has been unified with elementwise_sub(X, Y, axis=-1) from Paddle 2.0. If your code works well in the older versions but crashes in this version, try to use elementwise_sub(X, Y, axis=0) instead of A - B. This transitional warning will be dropped in the future. op_type, op_type, EXPRESSION_MAP[method_name])) Loading model from ./24L/Plato. Load pretraining parameters from ./24L/Plato Traceback (most recent call last): File "./knover/scripts/infer.py", line 140, in infer(args) File "./knover/scripts/infer.py", line 81, in infer predictions = task.infer_step(model, data) File "/home/aistudio/develop/Knover/knover/core/task.py", line 46, in infer_step outputs = self._post_process_infer_output(predictions) File "/home/aistudio/develop/Knover/knover/tasks/dialog_generation.py", line 162, in _post_process_infer_output return self._post_process_generation_output(predictions) File "/home/aistudio/develop/Knover/knover/tasks/dialog_generation.py", line 91, in _post_process_generation_output get_nsp_score_batch(self.nsp_predictor, predictions) File "/home/aistudio/develop/Knover/knover/tasks/dialog_generation.py", line 404, in get_nsp_score_batch outputs = nsp_predictor(data) File "/home/aistudio/develop/Knover/knover/utils/inference_utils.py", line 44, in predict return_numpy=True) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/executor.py", line 1110, in run six.reraise(*sys.exc_info()) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/six.py", line 703, in reraise raise value File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/executor.py", line 1108, in run return_merged=return_merged) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/executor.py", line 1238, in _run_impl use_program_cache=use_program_cache) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/executor.py", line 1313, in _run_program fetch_var_name=fetch_var_name) File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/executor.py", line 624, in _add_feed_fetch_ops if not has_feed_operators(global_block, feed, feed_var_name): File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/executor.py", line 280, in has_feed_operators format(feed_target_name)) Exception: 'feed_targets' does not have label_pos variable INFO 2021-04-14 12:08:55,230 launch_utils.py:307] terminate all the procs ERROR 2021-04-14 12:08:55,230 launch_utils.py:545] ABORT!!! Out of all 1 trainers, the trainer process with rank=[0] was aborted. Please check its log. INFO 2021-04-14 12:08:58,233 launch_utils.py:307] terminate all the procs

sserdoubleh commented 3 years ago

This issue might be help. I will update model link soon. https://github.com/PaddlePaddle/Knover/issues/44

sserdoubleh commented 3 years ago

The model links have updated. You can remove the __model__ under 24L/NSP directly and re-run the inference job.

nanzhao commented 3 years ago

it works now! Thanks for your quick fix.