booz-allen-hamilton / DSB3Tutorial

384 stars 197 forks source link

I got an error when the backend is tensorflow #10

Open Nvpiao opened 7 years ago

Nvpiao commented 7 years ago

when the backend is tensorflow, I got an error.

ValueError: Negative dimension size caused by subtracting 2 from 1 for 'MaxPool' (op: 'MaxPool') with input shapes: [?,1,512,32].

after I change the shape of Input, I got an another error


up6 = merge([UpSampling2D(size=(2, 2))(conv5), conv4], mode='concat', concat_axis=1)

ValueError: "concat" mode can only merge layers with matching output shapes except for the concat axis. Layer shapes: [(None, 64, 64, 512), (None, 64, 64, 256)]

next, I got this. chenge zhe conv5 have the same shape as conv4, But I still have a mistake at the same line.

up6 = merge([Convolution2D(256, 2, 2,activation='relu', border_mode='same')(UpSampling2D(size=(2, 2))(conv5)), conv4], mode='concat', concat_axis=1)

TypeError: Expected int32, got list containing Tensors of type '_Message' instead.

may you help me thx : )

ghost commented 7 years ago

Did you set the dimension ordering to theano? The unet uses (image_index, channel, dimx, dimy) which is not the ordering that tensorflow uses by default ''' K.set_image_dim_ordering('th') # Theano dimension ordering in this code '''

Nvpiao commented 7 years ago

@jonrmulholland Yeah,the dimension order confuse me so much. I forgot to say that the code was run in my windows pc last night. And may the different runtime ecv cause this. I now run the code in linux server and there is no any other error. Thanks a lot.

eshinesimida commented 7 years ago

I also have the same error.