Closed saeedalahmari3 closed 7 years ago
Oh, my bad, The images dimensions I have are (1,170,170) which cause problems since maxpooling followed by Upsampling will not give the same dimensions when concatenating. I resized my images to (1,160,160) and it is working fine.
up1 = merge([UpSampling2D(size=(2, 2))(conv3),conv2], mode='concat', concat_axis=1) This line is causing this error (
Traceback (most recent call last): File "retinaNN_training.py", line 144, in
model = get_unet(nb_epoch,img_width,img_hight) #the U-net model
File "retinaNN_training.py", line 47, in get_unet
up1 = merge([UpSampling2D(size=(2, 2))(conv3),conv2], mode='concat', concat_axis=1)
File "/share/apps/tensorflow_anaconda2/envs/tensorflow/lib/python2.7/site-packages/Keras-1.2.0-py2.7.egg/keras/engine/topology.py", line 1680, in merge
name=name)
File "/share/apps/tensorflow_anaconda2/envs/tensorflow/lib/python2.7/site-packages/Keras-1.2.0-py2.7.egg/keras/engine/topology.py", line 1299, in init
node_indices, tensor_indices)
File "/share/apps/tensorflow_anaconda2/envs/tensorflow/lib/python2.7/site-packages/Keras-1.2.0-py2.7.egg/keras/engine/topology.py", line 1371, in _arguments_validation
'Layer shapes: %s' % (input_shapes))
ValueError: "concat" mode can only merge layers with matching output shapes except for the concat axis. Layer shapes: [(None, 128, 84, 84), (None, 64, 85, 85)]
) Although I changed dim-ordering to "th", and Keras version 1.2.0.
???