Error: Getting 'tensor_desc' is not supported by the type of var _generated_var_0.
Created by: AkiraZC
自定义组网函数时报错,train时没有问题,eval时报错,请问为什么?
self.unique_ids = fluid.layers.data( name="unique_ids", shape=[-1, 1], lod_level=0, dtype="int64") _ = fluid.layers.assign(self.unique_ids)
fwd_cell = layers.GRUCell(hidden_size=1024) fwd_output, _ = layers.rnn(cell=fwd_cell,inputs=self.feature,time_major=False,is_reverse=False) bwd_cell = layers.GRUCell(hidden_size=1024) bwd_output, _ = layers.rnn(cell=bwd_cell,inputs=self.feature,time_major=False,is_reverse=True)
logits = fluid.layers.fc( input=layers.concat(input=[fwd_output, bwd_output, self.feature], axis=2), size=2, num_flatten_dims=2, param_attr=fluid.ParamAttr( name="cls_seq_label_out_w", initializer=fluid.initializer.TruncatedNormal(scale=0.02)), bias_attr=fluid.ParamAttr( name="cls_seq_label_out_b", initializer=fluid.initializer.Constant(0.)))
logits = fluid.layers.transpose(x=logits, perm=[2, 0, 1]) start_logits, end_logits = fluid.layers.unstack(x=logits, axis=0)
batch_ones = fluid.layers.fill_constant_batch_size_like( input=start_logits, dtype='int64', shape=[1], value=1) num_seqs = fluid.layers.reduce_sum(input=batch_ones)
return [start_logits, end_logits, num_seqs]