-
Notifications
You must be signed in to change notification settings - Fork 58
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
bert_bilstm_crf_adv:ValueError: Shape must be rank 2 but is rank 1 for 'task1_msra/crf_layer/Slice_2' (op: 'Slice') with input shapes: [?], [2], [2]. #10
Comments
报错信息: `During handling of the above exception, another exception occurred: Traceback (most recent call last): Process finished with exit code 1 |
@LinJingOK 是数据生成有问题,giga和bert是两个不同的tokenizer,前者是词粒度,后者是token粒度。bert模型使用的都是bert tokenizer,所以tfrecord文件是bert_train.tfrecord, 其他非bert模型是giga_train.tfrecord, 词表增强文件会是giga_softword.tfrecord之类的 |
您好,谢谢,这个问题已经解决,将bert的路径改为绝对路径解决了。目前生成了您所说的bert_train.tfrecord,bert_valid.tfrecord,bert_predict.tfrecord三个文件.我将config.py中的epoch_size设置为1,然后,执行了python main.py --model bert_bilstm_crf --data msr,项目跑起来了,gpu内存利用率也有,但是一次迭代已经训练了两个小时了还没有结束,输出预测信息,终端日志里面除了打印参数信息,剩下的都是warning,没有其他输出,我想问一下这样的训练是正常的吗,大概需要多久才能训练完成?我看您默认的迭代次数是50,您训练多久? |
@LinJingOK checkpoint里面会生成对应ckpt文件,可以用tensorboard --logdir ./checkpoint/your_model_path 来查看模型当前训练进展 |
很抱歉又要打扰您,我训练单任务花费了很长时间,但是程序能够正常结束,并作了evaluation,可以输出预测结果。现在我在跑(bert_bilstm_crf_adv.py)我的命令是python main.py --model bert_bilstm_crf_adv --data msra,msr,参数batch=16,epoch=1,程序正常运行了大概一个小时,程序报错了,生成的文件夹中ner_msra_msr_bert_bilstm_crf_adv中最后个文件是model.ckpt-7500,tensorboard中loss还在2左右,底层错误我先查找了环境的版本,重要的依赖与您的都保持一直了,报错信息如下: During handling of the above exception, another exception occurred: Traceback (most recent call last): Original stack trace for 'strided_slice_2': Process finished with exit code 1` |
@LinJingOK,您好,请问这个问题解决了吗,我bert_bilstm_crf_adv.py最近好像也遇到了这个问题,报错InvalidArgumentError,我的epoch_size也设置的是1。
|
No description provided.
The text was updated successfully, but these errors were encountered: