诺言14
2018-09-27 20:25
File "D:\Python_The second stage\mnist\model.py", line 14, in conv2b
return tf.nn.conv2d([1,1,1,1],padding="SAME")
TypeError: conv2d() missing 2 required positional arguments: 'filter' and 'strides'
以上是运行convolutional.py报错
def convolutional(x,keep_prob): def conv2b(x,W): return tf.nn.conv2d([1,1,1,1],padding="SAME") def max_pool_2x2(x): return tf.nn.max_pool(x,ksize=[1,2,2,1],strides=[1,2,2,1],padding="SAME") def weight_variable(shape): initial=tf.truncated_normal(shape,stddev=0.1) return tf.Variable(initial) def bias_variable(shape): initial=tf.constant(0.1,shape=shape) return tf.Variable(initial)
model.py代码和你一样
是什么原因?
TypeError: conv2d() missing 2 required positional arguments: 'filter' and 'strides'
我也是这个问题
def conv2d(x, W):
return tf.nn.conv2d(x, W, [1, 1, 1, 1], padding='SAME')
TypeError: conv2d() missing 2 required positional arguments: 'filter' and 'strides' 我也是回头来检查代码的 囧
根据你的提示,是缺少了两个参数,你看下应该是少加了什么代码
TensorFlow与Flask结合打造手写体数字识别
20428 学习 · 102 问题
相似问题