model = Model(model.input, output)
model.compile(
loss=CRF.sparse_loss,
optimizer=Adam(learing_rate),
metrics=[CRF.sparse_accuracy]
)
model.summary()
输出信息
# 请在此处贴上你的调试输出
```tensorflow.python.framework.errors_impl.FailedPreconditionError: Error while reading resource variable conditional_random_field/trans from Container: localhost. This could mean that the variable was uninitialized. Not found: Resource localhost/conditional_random_field/trans/N10tensorflow3VarE does not exist.
[[{{node ReadVariableOp}}]]
### 自我尝试
不管什么问题,请先尝试自行解决,“万般努力”之下仍然无法解决再来提问。此处请贴上你的努力过程。
提问时请尽可能提供如下信息:
基本信息
核心代码
with strategy.scope(): bert = build_transformer_model( config_path, checkpoint_path=None, return_keras_model=False ) model = bert.model output_layer = 'Transformer-%s-FeedForward-Norm' % (bert_layers - 1) output = model.get_layer(output_layer).output output = Dense(num_labels)(output) CRF = ConditionalRandomField(lr_multiplier=crf_lr_multiplier) output = CRF(output)
输出信息