Skip to content

Commit 1032942

Browse files
fix output dimension error
1 parent 8f5628d commit 1032942

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/dnlp/core/dnn_crf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(self, *, config: DnnCrfConfig = None, data_path: str = '', dtype: t
4545
self.output = self.get_output_layer(self.hidden_layer)
4646

4747
if mode == 'predict':
48-
self.output = tf.squeeze(self.output, axis=2)
48+
self.output = tf.squeeze(tf.transpose(self.output), axis=2)
4949
elif train == 'll':
5050
self.ll_loss, _ = tf.contrib.crf.crf_log_likelihood(self.output, self.real_indices, self.seq_length,
5151
self.transition)

0 commit comments

Comments
 (0)