luozhouyang
luozhouyang
@transformerzhou 对的,代码目前没有对这个进行判断,所以会有可能触发这个报错。有兴趣的话可以提交一个PR,感谢~
The `sequence_mask` has dim 3 `(256, 256, 3)`. However, `input mask` to CRF must have dim 2. And the `inputs` to CRF must have rank 3, but your inputs have...
hey guys, sorry for taking so long to reply to you. I refactored the code, the error you mentioned above is solved. You can found example in README.
Can you paste your code that build the Model?
Can you put the reproducible code in Colab, and paste the share link here?
`labels` are not need to do `one-hot` encoding
Just change these lines: ```bash # labels = [to_categorical(list(lab), num_classes=6) for lab in new_labs] labels = new_labs print(labels[0]) print(labels[0:3]) labels[0] labels = np.array(labels) ``` And you can get training results...
I'm not sure what caused this worse performance. But if you can get better performance without a CRF, you just remove this CRF layer. In any case, the CRF is...
推荐使用`tf.data` API构建数据输入管道,强大且方便。
文件格式随便你怎么处理都可以,在构建Dataset的时候按照你自己的格式读取就好了。一个文本很长建议进行截断,处理成多个训练样本。几个G预料不大。