aistudio@jupyter-208728-1765888:~/Knover$ git branch -av
develop dcf05a0 Support PaddlePaddle 2.0.
* master 4bad22c Fix checkpoints and add document for continuous training (#31)
remotes/origin/HEAD -> origin/develop
remotes/origin/develop dcf05a0 Support PaddlePaddle 2.0.
remotes/origin/dygraph 5a2fbec Support dygraph in PaddlePaddle 2.0 and add lic2021 baseline
remotes/origin/luge-dialogue 1b03ac1 update score
remotes/origin/master 4bad22c Fix checkpoints and add document for continuous training (#31)
remotes/origin/plato-2 4bad22c Fix checkpoints and add document for continuous training (#31)
aistudio@jupyter-208728-1765888:~/Knover$ python infer.py --model Plato --task DialogGeneration --vocab_path ./projects/lic2021/conf/vocab.txt --spm_model_file ./projects/lic2021/conf/spm.model --infer_file ./data/lic2021/test.txt --data_format numerical --file_format file --config_path ./projects/lic2021/conf/12L_P.json --init_pretraining_params Plato --batch_size 2 --max_src_len 384 --max_tgt_len 128 --max_seq_len 512 --output_name response --decoding_strategy topk_sampling --do_generation True --num_samples 4 --topk 5 --is_cn True --do_generation true --save_path ./projects/lic2021/infer/output --log_step 10
/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": false,
"save_path": "./projects/lic2021/infer/output",
"infer_file": "./data/lic2021/test.txt",
"output_name": "response",
"log_steps": 10,
"Model": {
"model": "Plato",
"config_path": "./projects/lic2021/conf/12L_P.json",
"init_checkpoint": "",
"init_pretraining_params": "Plato",
"learning_rate": 1e-05,
"warmup_steps": 0,
"weight_decay": 0.0,
"max_grad_norm": 0.1,
"use_recompute": false,
"use_amp": false,
"amp_loss_scaling": 12800,
"max_seq_len": 512,
"weight_sharing": true,
"mem_efficient": 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": 768,
"initializer_range": 0.02,
"max_position_embeddings": 512,
"latent_type_size": 20,
"num_attention_heads": 12,
"num_hidden_layers": 12,
"type_vocab_size": 2,
"role_type_size": 32,
"vocab_size": 30004
},
"Generator": {
"min_dec_len": 1,
"max_dec_len": 64,
"decoding_strategy": "topk_sampling",
"temperature": 1.0,
"ignore_unk": true,
"num_samples": 4,
"topk": 5,
"topp": 0.9,
"beam_size": 10,
"length_average": true,
"length_penalty": 0.0
},
"Task": {
"task": "DialogGeneration",
"do_generation": true,
"is_cn": true,
"nsp_inference_model_path": null,
"nsp_attention_style": "bidirectional",
"ranking_score": "decode_score"
},
"Reader": {
"max_src_len": 384,
"max_tgt_len": 128,
"truncate_first_turn": false,
"file_format": "file",
"data_format": "numerical",
"in_tokens": false,
"batch_size": 2,
"continuous_position": true,
"random_seed": 11,
"sort_pool_size": 65536
},
"Tokenizer": {
"tokenizer": "SentencePieceTokenizer",
"vocab_path": "./projects/lic2021/conf/vocab.txt",
"do_lower_case": false,
"spm_model_file": "./projects/lic2021/conf/spm.model"
},
"run_infer": true
}
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py:298: UserWarning: /home/aistudio/Knover/models/unified_transformer.py:119
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/Knover/models/transformer_block.py:116
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/Knover/models/transformer_block.py:217
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/Knover/models/generator.py:161
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/Knover/models/generator.py:209
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/Knover/models/generator.py:209
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/Knover/models/generator.py:239
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/Knover/models/generator.py:239
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]))
W0412 19:20:59.318835 4704 device_context.cc:362] Please NOTE: device: 0, GPU Compute Capability: 7.0, Driver API Version: 11.0, Runtime API Version: 10.1
W0412 19:20:59.322726 4704 device_context.cc:372] device: 0, cuDNN Version: 7.6.
Load pretraining parameters from Plato.
Traceback (most recent call last):
File "infer.py", line 139, in <module>
infer(args)
File "infer.py", line 86, in infer
predictions = task.infer_step(model, data)
File "/home/aistudio/Knover/tasks/task_base.py", line 43, in infer_step
predictions = model.infer_step(inputs)
File "/home/aistudio/Knover/models/plato.py", line 280, in infer_step
return super(Plato, self).infer_step(inputs)
File "/home/aistudio/Knover/models/unified_transformer.py", line 439, in infer_step
predictions = self._run_generation(inputs)
File "/home/aistudio/Knover/models/unified_transformer.py", line 394, in _run_generation
return_numpy=False)
File "/home/aistudio/Knover/models/model_base.py", line 266, in _execute
fetch_vars = self.exe.run(program, feed, fetch_list, **kwargs)
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 1328, in _run_program
[fetch_var_name])
ValueError: In user code:
File "infer.py", line 139, in <module>
infer(args)
File "infer.py", line 72, in infer
model = models.create_model(args, place)
File "/home/aistudio/Knover/models/__init__.py", line 49, in create_model
return MODEL_REGISTRY[args.model](args, place)
File "/home/aistudio/Knover/models/plato.py", line 49, in __init__
super(Plato, self).__init__(args, place)
File "/home/aistudio/Knover/models/unified_transformer.py", line 93, in __init__
super(UnifiedTransformer, self).__init__(args, place)
File "/home/aistudio/Knover/models/model_base.py", line 74, in __init__
self._build_programs()
File "/home/aistudio/Knover/models/model_base.py", line 91, in _build_programs
predictions = self.infer(inputs, outputs)
File "/home/aistudio/Knover/models/unified_transformer.py", line 380, in infer
return self.generator.inference(self, inputs, outputs)
File "/home/aistudio/Knover/models/generator.py", line 175, in inference
gather_idx=parent_idx)
File "/home/aistudio/Knover/models/unified_transformer.py", line 178, in _generation_network
gather_idx=gather_idx)
File "/home/aistudio/Knover/models/unified_transformer.py", line 202, in _encode
store=caches is not None
File "/home/aistudio/Knover/models/transformer_block.py", line 376, in encoder
store=store)
File "/home/aistudio/Knover/models/transformer_block.py", line 288, in encoder_layer
store=store)
File "/home/aistudio/Knover/models/transformer_block.py", line 158, in multi_head_attention
dropout_rate)
File "/home/aistudio/Knover/models/transformer_block.py", line 116, in scaled_dot_product_attention
product += attn_bias
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/layers/math_op_patch.py", line 304, in __impl__
attrs={'axis': axis})
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/framework.py", line 3023, in append_op
attrs=kwargs.get("attrs", None))
File "/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/framework.py", line 2107, in __init__
for frame in traceback.extract_stack():
InvalidArgumentError: Broadcast dimension mismatch. Operands could not be broadcast together with the shape of X = [160, 12, 160, 427] and the shape of Y = [160, 12, 1, 268]. Received [427] in X is not equal to [268] in Y at i:3.
[Hint: Expected x_dims_array[i] == y_dims_array[i] || x_dims_array[i] <= 1 || y_dims_array[i] <= 1 == true, but received x_dims_array[i] == y_dims_array[i] || x_dims_array[i] <= 1 || y_dims_array[i] <= 1:0 != true:1.] (at /paddle/paddle/fluid/operators/elementwise/elementwise_op_function.h:160)
[operator < elementwise_add > error]
aistudio@jupyter-208728-1765888:~/Knover$