PaddlePaddle / ERNIE

Official implementations for various pre-training models of ERNIE-family, covering topics of Language Understanding & Generation, Multimodal Understanding & Generation, and beyond.
6.32k stars 1.28k forks source link

ERNIE中的text_generation训练报错 #910

Open hello-word-1 opened 1 year ago

hello-word-1 commented 1 year ago

配置信息:device: 0, GPU Compute Capability: 6.1, Driver API Version: 12.2, Runtime API Version: 11.2

报错信息: Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations if arr.dtype == np.object: ERROR: 06-16 14:18:42: custom_static_generation_trainer.py:113 14080 traceback.format_exc():Traceback (most recent call last): File "D:\lenovo\ERNIE\ERNIE\applications\tasks\text_generation\trainer\custom_static_generation_trainer.py", line 55, in do_train self.train_exe.run(fetch_list=[], return_numpy=True) File "D:\tool\anaconda3\envs\erine-demo\lib\site-packages\paddle\fluid\parallel_executor.py", line 307, in run return_numpy=return_numpy) File "D:\tool\anaconda3\envs\erine-demo\lib\site-packages\paddle\fluid\executor.py", line 1262, in run six.reraise(sys.exc_info()) File "D:\tool\anaconda3\envs\erine-demo\lib\site-packages\six.py", line 719, in reraise raise value File "D:\tool\anaconda3\envs\erine-demo\lib\site-packages\paddle\fluid\executor.py", line 1260, in run return_merged=return_merged) File "D:\tool\anaconda3\envs\erine-demo\lib\site-packages\paddle\fluid\executor.py", line 1415, in _run_impl return_merged=return_merged) File "D:\tool\anaconda3\envs\erine-demo\lib\site-packages\paddle\fluid\executor.py", line 1065, in _run_parallel tensors = exe.run(fetch_var_names, return_merged)._move_to_list() ValueError: In user code:

File "D:\lenovo\ERNIE\ERNIE\applications\tasks\text_generation\run_trainer_ernie_gen.py", line 121, in <module>
  run_trainer(_params)
File "D:\lenovo\ERNIE\ERNIE\applications\tasks\text_generation\run_trainer_ernie_gen.py", line 100, in run_trainer
  trainer = build_trainer(trainer_params_dict, dataset_reader, model, num_train_examples)
File "D:\lenovo\ERNIE\ERNIE\applications\tasks\text_generation\run_trainer_ernie_gen.py", line 83, in build_trainer
  trainer = trainer_class(params=params_dict, data_set_reader=dataset_reader, model=model)
File "D:\lenovo\ERNIE\ERNIE\applications\tasks\text_generation\trainer\custom_static_generation_trainer.py", line 27, in __init__
  BaseStaticTrainerErnieGen.__init__(self, params, data_set_reader, model)
File "D:\lenovo\ERNIE\ERNIE\erniekit\controller\static_trainer_ernie_gen.py", line 65, in __init__
  self.init_env_static()
File "D:\lenovo\ERNIE\ERNIE\erniekit\controller\static_trainer_ernie_gen.py", line 310, in init_env_static
  self.init_static_model_net()
File "D:\lenovo\ERNIE\ERNIE\erniekit\controller\static_trainer_ernie_gen.py", line 345, in init_static_model_net
  self.init_static_train_net()
File "D:\lenovo\ERNIE\ERNIE\erniekit\controller\static_trainer_ernie_gen.py", line 366, in init_static_train_net
  fields_dict, phase=InstanceName.TRAINING)
File "D:\lenovo\ERNIE\ERNIE\applications\tasks\text_generation\model\ernie_infilling_generation.py", line 133, in forward
  emb_dict = self.make_embedding(fields_dict, phase)
File "D:\lenovo\ERNIE\ERNIE\applications\tasks\text_generation\model\ernie_infilling_generation.py", line 383, in make_embedding
  two_stream=self.two_stream
File "D:\lenovo\ERNIE\ERNIE\erniekit\modules\ernie_gen.py", line 116, in __init__
  input_mask, gather_idx, role_ids, turn_ids)
File "D:\lenovo\ERNIE\ERNIE\erniekit\modules\ernie_gen.py", line 272, in _build_model
  role_ids=role_ids, turn_ids=turn_ids)
File "D:\lenovo\ERNIE\ERNIE\erniekit\modules\ernie_gen.py", line 204, in encode
  role_ids=role_ids[0], turn_ids=turn_ids[0])
File "D:\lenovo\ERNIE\ERNIE\erniekit\modules\ernie_gen.py", line 135, in _gen_input
  is_sparse=False)
File "D:\tool\anaconda3\envs\erine-demo\lib\site-packages\paddle\fluid\layers\nn.py", line 521, in embedding
  'padding_idx': padding_idx
File "D:\tool\anaconda3\envs\erine-demo\lib\site-packages\paddle\fluid\layer_helper.py", line 43, in append_op
  return self.main_program.current_block().append_op(*args, **kwargs)
File "D:\tool\anaconda3\envs\erine-demo\lib\site-packages\paddle\fluid\framework.py", line 3184, in append_op
  attrs=kwargs.get("attrs", None))
File "D:\tool\anaconda3\envs\erine-demo\lib\site-packages\paddle\fluid\framework.py", line 2224, in __init__
  for frame in traceback.extract_stack():

InvalidArgumentError: Tensor holds the wrong type, it holds int, but desires to be int64_t.
  [Hint: Expected valid == true, but received valid:0 != true:1.] (at ..\paddle/fluid/framework/tensor_impl.h:33)
  [operator < lookup_table > error]
stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Feel free to reopen it. Thank you for your contributions.