私はPythonコードのこのビットを実行しようとしていたし、エラーを回避することができないように無効な引数エラー:Tensorflow:コンボリューション
ここtf.nn.conv2d(tf.reshape(x, [5, 5]), tf.reshape(wt, [3, 3]), strides=[1, 1], padding='SAME')
は、xはtf.Variable
である(5,5 )numpy配列であり、wは(3,3)numpy配列からのtf.Variableです。
私が手にエラーがある:tf.nn.conv2d
を使用するためには
---------------------------------------------------------------------------
InvalidArgumentError Traceback (most recent call last)
C:\Anaconda3\lib\site-packages\tensorflow\python\framework\common_shapes.py in _call_cpp_shape_fn_impl(op, input_tensors_needed, input_tensors_as_shapes_needed, debug_python_shape_fn, require_shape_fn)
669 node_def_str, input_shapes, input_tensors, input_tensors_as_shapes,
--> 670 status)
671 except errors.InvalidArgumentError as err:
C:\Anaconda3\lib\contextlib.py in __exit__(self, type, value, traceback)
65 try:
---> 66 next(self.gen)
67 except StopIteration:
C:\Anaconda3\lib\site-packages\tensorflow\python\framework\errors_impl.py in raise_exception_on_not_ok_status()
468 compat.as_text(pywrap_tensorflow.TF_Message(status)),
--> 469 pywrap_tensorflow.TF_GetCode(status))
470 finally:
InvalidArgumentError: Shape must be rank 4 but is rank 2 for 'Conv2D_19' (op: 'Conv2D') with input shapes: [5,5], [3,3].