Closed hendaboudegga closed 5 years ago
Hi! This issue isn't related to a bug/enhancement/feature request or other accepted types of issue. To ask questions, please see the following resources : StackOverflow Keras Slack channel Keras.io support Gitter Thanks! If you think we made a mistake, please open another issue explaining your request in detail.
hello everyone, i am working for vessel segmentation from retinal image. i am using an autoencoder network with softmax activation function for the final layer. this is my following code for training and prediction:
** training code //loss function losses =tf.nn.softmax_cross_entropy_with_logits(labels=net_output, logits=network)
cost = tf.reduce_mean(losses) tf.summary.scalar("cross_entropy", cost) //Adam optimizer opt = tf.train.AdamOptimizer(args.learning_rate).minimize(cost, var_list=[var for var in tf.trainable_variables()])
init = tf.global_variables_initializer()
correct_prediction = tf.equal(tf.argmax(network, 1), tf.argmax(net_output, 1)) accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
for epoch in range(0, args.num_epochs):
//training
_,current=sess.run([opt, cost],feed_dict={net_input:input_img, net_output:output_img}) print("loss of img "+str(i) +" slice " +str(k)+" ="+str(current))
**prediction code
the value of accuracy look logic it converge after each epoch but when i try to predict an image after training all the epochs, the value of predicted array output look like this:
//result of prediction [[[[4.4425573e-02 8.8295966e-01] [5.4390044e-03 9.7242403e-01] [1.9392670e-03 9.8569876e-01]
and the image is full white. any help please!!