cnn-text-classification-tf icon indicating copy to clipboard operation
cnn-text-classification-tf copied to clipboard

ValueError: Variable output/W already exists, disallowed.

Open syw2014 opened this issue 7 years ago • 0 comments

ValueError: Variable output/W_project already exists, disallowed. Did you mean to set reuse=True in VarScope? Originally defined at:

with tf.name_scope("output"): W= tf.Variable( "W", shape=[num_filters_total, self.config.num_classes], initializer=tf.contrib.layers.xavier_initializer()) b = tf.Variable(tf.constant(0.1, shape=[self.config.num_classes]), name="b") l2_loss += tf.nn.l2_loss(W_project) l2_loss += tf.nn.l2_loss(b) self.scores = tf.nn.xw_plus_b(self.h_drop, W_project, b, name="scores") ## error here self.predict_y = tf.argmax(self.scores, 1, name="prediction")

Any suggestions, thanks!

syw2014 avatar Oct 20 '17 08:10 syw2014