I was able to reproduce the exception with the form tensor (None, None, None, 9)when called np.prod()as follows:
from keras import backend as K
z = K.placeholder(shape=(None, None, None, 9))
actual_shape = K.int_shape(z)
dim = np.prod(actual_shape[1:])
, None, actual_shape ( 1 , None). TypeError None int, -.
, , , , :
, 1 undefined, tf.shape() tf.reduce_prod().
, API Keras, K.shape() (docs) K.prod() (docs), :
z = K.placeholder(shape=(None, None, None, 9))
dim = K.prod(K.shape(z)[1:])
z2 = K.reshape(z, [-1,dim])
, , undefined K.int_shape(z) K.get_variable_shape(z) get_shape(), (docs). , .