对于 'max_pooling3d_10/MaxPool3D' (op: 'MaxPool3D'),输入形状为 [?,1,240,135,512],从 1 中减去 2 导致的负维度大小

Negative dimension size caused by subtracting 2 from 1 for 'max_pooling3d_10/MaxPool3D' (op: 'MaxPool3D') with input shapes: [?,1,240,135,512]

InvalidArgumentError                      Traceback (most recent call last)
~\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py in _create_c_op(graph, node_def, inputs, control_inputs)
   1863   try:
-> 1864     c_op = c_api.TF_FinishOperation(op_desc)
   1865   except errors.InvalidArgumentError as e:

InvalidArgumentError: Negative dimension size caused by subtracting 2 from 1 for 'max_pooling3d_37/MaxPool3D' (op: 'MaxPool3D') with input shapes: [?,1,240,135,512].

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
<ipython-input-20-b2b323640e12> in <module>
     12 model.add(tf.keras.layers.Conv3D(512 , kernel_size = (3,3,3) ,strides = (1,1,1) , padding = 'same' , activation = 'relu'))
     13 model.add(tf.keras.layers.Conv3D(512 , kernel_size = (3,3,3) ,strides = (1,1,1) , padding = 'same' , activation = 'relu'))
---> 14 model.add(tf.keras.layers.MaxPooling3D(pool_size = (2,2,2) , strides = (2,2,2)))
     15 model.add(tf.keras.layers.Conv3D(1024 , kernel_size = (3,3,3) ,strides = (1,1,1) , padding = 'same' , activation = 'relu'))
     16 model.add(tf.keras.layers.Conv3D(1024 , kernel_size = (3,3,3) ,strides = (1,1,1) , padding = 'same' , activation = 'relu'))

~

我认为您提供的尺寸可能有误,或者您的框架尺寸不够大。输入数据形状错误。