Traffic-Sign-CNN
Traffic-Sign-CNN copied to clipboard
NameError: name 'logits' is not defined
hi. i run the code and get the NameError. in here we have the logits. ` tf.add_to_collection('logits', logits)
return logits,weights
logits,weights = LeNet(x)
cross_entropy = tf.nn.softmax_cross_entropy_with_logits(logits=logits, labels=one_hot_y)`
but in the other part of the code i get the error:
correct_prediction = tf.equal(tf.argmax(logits, 1), tf.argmax(one_hot_y, 1)) accuracy_operation = tf.reduce_mean(tf.cast(correct_prediction, tf.float32)) #added after initial training in order to retrieve collection for testing new data in part 7 tf.add_to_collection('accuracy_operation', accuracy_operation)
what's the problem?