wuyang0329 / unet

this is a simple demo for image segmentation.----unet网络进行语义分割的demo,用的数据集是KITTI
97 stars 38 forks source link

关于maxpooling #7

Open ziying6027 opened 5 years ago

ziying6027 commented 5 years ago

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

想问一下这个报错是怎么回事?谢谢

wuyang0329 commented 5 years ago

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

想问一下这个报错是怎么回事?谢谢

你要提供完整的报错信息才行,这个办法判断是哪里的问题,感觉像是数据格式不对

ziying6027 commented 5 years ago

还有我想问一下,我现在在用dcm格式转成的npy文件输入到你的模型里面运行,这样做可以吗?我之前用别人的模型输出的都是全黑的图,也找不出问题所在,如果方便的话可以简单的解答一下吗?谢谢了

ziying6027 commented 5 years ago

Negative dimension size caused by subtracting 2 from 1 for 'max_pooling2d_11/MaxPool' (op: 'MaxPool') with input shapes: [?,1,512,64] 想问一下这个报错是怎么回事?谢谢

你要提供完整的报错信息才行,这个办法判断是哪里的问题,感觉像是数据格式不对

Traceback (most recent call last):

File "", line 1, in runfile('C:/Users/Terry/unetmaster/untitled2.py', wdir='C:/Users/Terry/unetmaster')

File "C:\Users\Terry\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 704, in runfile execfile(filename, namespace)

File "C:\Users\Terry\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 108, in execfile exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/Terry/unetmaster/untitled2.py", line 132, in train_and_predict(False)

File "C:/Users/Terry/unetmaster/untitled2.py", line 88, in train_and_predict model = get_unet()

File "C:/Users/Terry/unetmaster/untitled2.py", line 19, in get_unet pool1 = MaxPooling2D(pool_size=(2, 2))(conv1)

File "C:\Users\Terry\Anaconda3\lib\site-packages\keras\engine\base_layer.py", line 457, in call output = self.call(inputs, **kwargs)

File "C:\Users\Terry\Anaconda3\lib\site-packages\keras\layers\pooling.py", line 205, in call data_format=self.data_format)

File "C:\Users\Terry\Anaconda3\lib\site-packages\keras\layers\pooling.py", line 268, in _pooling_function pool_mode='max')

File "C:\Users\Terry\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py", line 3978, in pool2d data_format=tf_data_format)

File "C:\Users\Terry\Anaconda3\lib\site-packages\tensorflow\python\ops\nn_ops.py", line 2748, in max_pool name=name)

File "C:\Users\Terry\Anaconda3\lib\site-packages\tensorflow\python\ops\gen_nn_ops.py", line 5136, in max_pool data_format=data_format, name=name)

File "C:\Users\Terry\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 788, in _apply_op_helper op_def=op_def)

File "C:\Users\Terry\Anaconda3\lib\site-packages\tensorflow\python\util\deprecation.py", line 507, in new_func return func(*args, **kwargs)

File "C:\Users\Terry\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 3300, in create_op op_def=op_def)

File "C:\Users\Terry\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1823, in init control_input_ops)

File "C:\Users\Terry\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1662, in _create_c_op raise ValueError(str(e))

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

wuyang0329 commented 5 years ago

还有我想问一下,我现在在用dcm格式转成的npy文件输入到你的模型里面运行,这样做可以吗?我之前用别人的模型输出的都是全黑的图,也找不出问题所在,如果方便的话可以简单的解答一下吗?谢谢了

你这个应该就是输入的训练数据格式不正确导致的,建议你将训练数据重新处理一下再进行训练,具体的格式的话参照Camvid数据集的数据就可以了