shekkizh / FCN.tensorflow

Tensorflow implementation of Fully Convolutional Networks for Semantic Segmentation (http://fcn.berkeleyvision.org)
MIT License
1.25k stars 527 forks source link

Training accuracy 100%, validation accuracy half of it (near 50%); blank prediction image #64

Closed sanjeevan1234 closed 6 years ago

sanjeevan1234 commented 7 years ago

I am replicating the same code for binary classification. I added a code to get training accuracy and validation accuracy. But, unfortunately, training accuracy increased to 100% after few iteration but every time, validation accuracy is half of training accuracy.

Can you tell me the possible reason?

Also, I am getting blank prediction image while using inference.

Can you tell me what is the possible reason and solution?

dubvulture commented 7 years ago

Did you try lowering the learning rate? (see my older comment)

lily10086 commented 7 years ago

Can you share me the training accuracy and validation accuracy code??

sanjeevan1234 commented 7 years ago

Hello, I used this code to get validation and training accuracy.

keep_prob= tf.placeholder(tf.float32, name="keep_probabilty") #Dropout probability

.........................Placeholders for input image and labels...........................................................................................

image = tf.placeholder(tf.float32, shape=[None, None, None, 3], name="input_image") #Input image batch first dimension image number second dimension width third dimension height 4 dimension RGB
GTLabel = tf.placeholder(tf.int32, shape=[None, None, None, 1], name="GTLabel")#Ground truth labels for training

.........................Build FCN Net...............................................................................................

Net =  BuildNetVgg16.BUILD_NET_VGG16(vgg16_npy_path=model_path) #Create class for the network
Net.build(image, NUM_CLASSES,keep_prob)# Create the net and load intial weights

......................................Get loss functions for neural net work one loss function for each set of label....................................................................................................

...................................... Get accuracy function for neural network one accuracy function for each set of Label

correct_prediction = tf.equal(tf.argmax(Net.Prob, 3), tf.argmax(GTLabel, 3))
accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))

Thank you.

shekkizh commented 6 years ago

Closing due to inactivity