以下脚本不起作用:
import tensorflow as tf
import numpy as np
input = np.ones((1,1, 3,50,50))
t_ph = tf.placeholder(dtype=tf.float32, shape=(1,1,3,None,50), name='input')
# t_ph = tf.placeholder(dtype=tf.float32, shape=(1,1,3,50,50), name='input')
t_conv3d = tf.layers.conv3d(
inputs=t_ph,
filters=48,
kernel_size=[3,3,3],
data_format='channels_first',
activation=tf.nn.relu
)
with tf.Session() as sess:
sess.run([tf.local_variables_initializer(), tf.global_variables_initializer()])
should_fail = t_conv3d.eval(feed_dict={t_ph: input})
print "should_fail ", should_fail.shape
错误:TypeError: unsupported operand type(s) for *: 'int' and 'NoneType'
是否可以使用参数'None'而不是整数的conv3d?