bojone/bert4keras

pretraining预训练问题

wuuyanru opened this issue · 0 comments

提问时请尽可能提供如下信息:

基本信息

  • 你使用的操作系统:
  • 你使用的3.6版本:
  • 你使用的Tensorflow1.15版本:
  • 你使用的Keras2.3.1版本:
  • 你使用的bert4keras版本:
  • 你使用纯tf.keras:
  • 你加载的预训练模型roberta:

核心代码

# 请在此处贴上你的核心代码。
# 请尽量只保留关键部分,不要无脑贴全部代码。

# os.environ['TF_KERAS'] = '1'  # 必须使用tf.keras
os.environ["CUDA_VISIBLE_DEVICES"] = "0"

#######config
sequence_length = 64
batch_size = 1
config_path = '../../../../pretrainedmodels/chinese_roberta_wwm_ext_L-12_H-768_A-12/bert_config.json'
checkpoint_path = '../../../../pretrainedmodels/chinese_roberta_wwm_ext_L-12_H-768_A-12/bert_model.ckpt'  # 如果从零训练,就设为None
learning_rate = 0.00176
weight_decay_rate = 0.01
num_warmup_steps = 3125
num_train_steps = 125000
steps_per_epoch = 1000 

输出信息

# 请在此处贴上你的调试输出
tensorflow.python.framework.errors_impl.InvalidArgumentError: 2 root error(s) found.
  (0) Invalid argument: {{function_node __inference_Dataset_map_parse_function_46}} Key: mask_ids.  Can't parse serialized Example.
	 [[{{node ParseSingleExample/ParseSingleExample}}]]
	 [[MultiDeviceIteratorGetNextFromShard]]
	 [[RemoteCall]]
	 [[IteratorGetNext]]
	 [[loss_1/div_no_nan/ReadVariableOp_1/_5789]]
  (1) Invalid argument: {{function_node __inference_Dataset_map_parse_function_46}} Key: mask_ids.  Can't parse serialized Example.
	 [[{{node ParseSingleExample/ParseSingleExample}}]]
	 [[MultiDeviceIteratorGetNextFromShard]]
	 [[RemoteCall]]
	 [[IteratorGetNext]]
0 successful operations.
0 derived errors ignored.

自我尝试

不管什么问题,请先尝试自行解决,“万般努力”之下仍然无法解决再来提问。此处请贴上你的努力过程。
linux 与win10都尝试了
卡:3080 与 2060s
参数大小也都试过
是否指定显卡为0
其他百度方案