AstarLight / Satellite-Segmentation

615 stars 233 forks source link

seg_net在第二次池化提示错误 #36

Open strivehub opened 5 years ago

strivehub commented 5 years ago

ValueError: Negative dimension size caused by subtracting 2 from 1 for 'max_pooling2d_2/MaxPool' (op: 'MaxPool') with input shapes: [?,1,128,128]. 楼主该怎么处理??

fengfeng222 commented 5 years ago

同问

zhaojw219 commented 5 years ago

ValueError: Negative dimension size caused by subtracting 2 from 1 for 'max_pooling2d_2/MaxPool' (op: 'MaxPool') with input shapes: [?,1,128,128]. 楼主该怎么处理??

试一下在函数起始部分加上: from keras import backend as K
K.set_image_dim_ordering('th')

FrancisDacian commented 5 years ago

ValueError: Negative dimension size caused by subtracting 2 from 1 for 'max_pooling2d_2/MaxPool' (op: 'MaxPool') with input shapes: [?,1,128,128]. 楼主该怎么处理??

试一下在函数起始部分加上: from keras import backend as K K.set_image_dim_ordering('th')

Thanks bro.

Angel0003 commented 4 years ago

ValueError: Negative dimension size caused by subtracting 2 from 1 for 'max_pooling2d_2/MaxPool' (op: 'MaxPool') with input shapes: [?,1,128,128]. 楼主该怎么处理??

试一下在函数起始部分加上: from keras import backend as K K.set_image_dim_ordering('th')

哪個函數起始,segnet_train.py的import那裏嗎

Angel0003 commented 4 years ago

哪個函數起始,segnet_train.py的import那裏嗎

zhilonglu commented 1 year ago

直接在segnet_train函数的最开始添加就OK,是因为版本更新问题。 set_image_dim_ordering(dim_ordering)是用于设置图像的维度顺序的,有2个可选参数: (1)‘th’:即Theano模式,会把通道维放在第二个位置上。 (2)‘tf’:即TensorFlow模式,会把通道维放在最后的位置上。