Some problems in running attention.py
Opened this issue · 1 comments
Hi, I cloned your project and try to use it. Your code is fabulous.
However when I run python attention.py
there's always an error appear:
Caused by op 'pool1', defined at:
File ".\attention.py", line 37, in
ctx = tflib.network.im2latex_cnn(X,NUM_FEATS_START,True)
File "D:\THU\challengeCup\im2latex-tensorflow-master\tflib\network.py", line 77, in im2latex_cnn
X = tflib.ops.max_pool('pool1', X, k=2, s=2)
File "D:\THU\challengeCup\im2latex-tensorflow-master\tflib\ops.py", line 239, in max_pool
padding='SAME', name=name, data_format='NCHW')
File "C:\Users\Ellen\Anaconda3\lib\site-packages\tensorflow\python\ops\nn_ops.py", line 1617, in max_pool
name=name)
File "C:\Users\Ellen\Anaconda3\lib\site-packages\tensorflow\python\ops\gen_nn_ops.py", line 1598, in _max_pool
data_format=data_format, name=name)
File "C:\Users\Ellen\Anaconda3\lib\site-packages\tensorflow\python\framework\op_def_library.py", line 759, in apply_op
op_def=op_def)
File "C:\Users\Ellen\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 2240, in create_op
original_op=self._default_original_op, op_def=op_def)
File "C:\Users\Ellen\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1128, in init
self._traceback = _extract_stack()
InvalidArgumentError (see above for traceback): Default MaxPoolingOp only supports NHWC.
[[Node: pool1 = MaxPoolT=DT_FLOAT, data_format="NCHW", ksize=[1, 1, 2, 2], padding="SAME", strides=[1, 1, 2, 2
], _device="/job:localhost/replica:0/task:0/cpu:0"]]
Does this mean I'm not preprocess the data properly? Or is there any possible reasons for this? How can I correct it?