Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: Depth of input (32) is not a multiple of input depth of filter (64) for 'conv2/Conv2D' (op: 'Conv2D') with input shapes: [?,?,?,32], [3,3,64,128]. #24

Open
sarthakforwet opened this issue Nov 27, 2019 · 1 comment

Comments

@sarthakforwet
Copy link

Hey there,
Thanks for sharing your code with us . I tried my best to remove all the glitches that occured in ops.py , predict.py .
Things I changed

  1. According to the official tensorflow documentation tf.split() function has changed in attributes postion in the recent versions (https://www.tensorflow.org/api_docs/python/tf/split) .However the code you shared contains the definition from the previous version so changed that to the new one.

  2. There were some areas where the state variable in ops.py is splitted in such dimensions that they were not matching with the input dimension when concatenating.So i changed that somehow and got that to run .

  3. I converted the data format argument in ops.py from "NCHW" to "NHWC" because the latex one only supports the CPU.

However after all these Solving of errors , I was able to start the frontend which was from this repo https://github.com/yixuanzhou/image2latex . But when I run predict.py i am still getting an error from network.py in tflib folder.

The Error is as Follows :

Traceback (most recent call last):
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 1864, in _create_c_op
c_op = c_api.TF_FinishOperation(op_desc)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Depth of input (32) is not a multiple of input depth of filter (64) for 'conv2/Conv2D' (op: 'Conv2D') with input shapes: [?,?,?,32], [3,3,64,128].

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\scanner\image2latex\predict.py", line 31, in
ctx = tflib.network.im2latex_cnn(X,NUM_FEATS_START,True)
File "c:\scanner\image2latex\tflib\network.py", line 79, in im2latex_cnn
X = tf.nn.relu(tflib.ops.conv2d('conv2', X, 3, 1, num_feats, num_feats*2, pad = 'SAME', bias=True))
File "c:\scanner\image2latex\tflib\ops.py", line 203, in conv2d
out = tf.nn.conv2d(input,filters=filters, strides=[1, 1, stride, stride], padding=pad, data_format='NHWC')
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\nn_ops.py", line 1953, in conv2d
name=name)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\gen_nn_ops.py", line 1160, in conv2d
data_format=data_format, dilations=dilations, name=name)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\util\deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 3616, in create_op
op_def=op_def)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 2027, in init
control_input_ops)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 1867, in _create_c_op
raise ValueError(str(e))
ValueError: Depth of input (32) is not a multiple of input depth of filter (64) for 'conv2/Conv2D' (op: 'Conv2D') with input shapes: [?,?,?,32], [3,3,64,128].

(base) C:\Users\Sarthak>python -u "c:\scanner\image2latex\predict.py"
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
WARNING: Logging before flag parsing goes to stderr.
W1127 19:41:30.626686 17720 configdefaults.py:515] g++ not available, if using conda: conda install m2w64-toolchain
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\theano\configdefaults.py:560: UserWarning: DeprecationWarning: there is no c++ compiler.This is deprecated and with Theano 0.11 a c++ compiler will be mandatory
warnings.warn("DeprecationWarning: there is no c++ compiler."
W1127 19:41:30.636664 17720 configdefaults.py:580] g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
W1127 19:41:31.051667 17720 blas_headers.py:988] Using NumPy C-API based implementation for BLAS functions.
W1127 19:41:31.224253 17720 deprecation_wrapper.py:119] From c:\scanner\image2latex\tflib\ops.py:258: The name tf.nn.rnn_cell.RNNCell is deprecated. Please use tf.compat.v1.nn.rnn_cell.RNNCell instead.

W1127 19:41:31.309074 17720 deprecation_wrapper.py:119] From c:\scanner\image2latex\predict.py:23: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

W1127 19:41:31.390878 17720 deprecation_wrapper.py:119] From c:\scanner\image2latex\tflib\ops.py:245: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

Traceback (most recent call last):
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 1864, in _create_c_op
c_op = c_api.TF_FinishOperation(op_desc)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Depth of input (64) is not a multiple of input depth of filter (128) for 'conv3/Conv2D' (op: 'Conv2D') with input shapes: [?,?,?,64], [3,3,128,256].

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\scanner\image2latex\predict.py", line 31, in
ctx = tflib.network.im2latex_cnn(X,NUM_FEATS_START,True)
File "c:\scanner\image2latex\tflib\network.py", line 82, in im2latex_cnn
X = tf.nn.relu(tflib.ops.conv2d('conv3', X, 3, 1, num_feats2, num_feats4, batchnorm=bn, is_training=train_mode, pad = 'SAME', bias=False))
File "c:\scanner\image2latex\tflib\ops.py", line 203, in conv2d
out = tf.nn.conv2d(input,filters=filters, strides=[1, 1, stride, stride], padding=pad, data_format='NHWC')
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\nn_ops.py", line 1953, in conv2d
name=name)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\gen_nn_ops.py", line 1160, in conv2d
data_format=data_format, dilations=dilations, name=name)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\util\deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 3616, in create_op
op_def=op_def)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 2027, in init
control_input_ops)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 1867, in _create_c_op
raise ValueError(str(e))
ValueError: Depth of input (64) is not a multiple of input depth of filter (128) for 'conv3/Conv2D' (op: 'Conv2D') with input shapes: [?,?,?,64], [3,3,128,256].

(base) C:\Users\Sarthak>python -u "c:\scanner\image2latex\predict.py"
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
WARNING: Logging before flag parsing goes to stderr.
W1127 19:42:26.482462 16544 configdefaults.py:515] g++ not available, if using conda: conda install m2w64-toolchain
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\theano\configdefaults.py:560: UserWarning: DeprecationWarning: there is no c++ compiler.This is deprecated and with Theano 0.11 a c++ compiler will be mandatory
warnings.warn("DeprecationWarning: there is no c++ compiler."
W1127 19:42:26.492436 16544 configdefaults.py:580] g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
W1127 19:42:26.897433 16544 blas_headers.py:988] Using NumPy C-API based implementation for BLAS functions.
W1127 19:42:27.063021 16544 deprecation_wrapper.py:119] From c:\scanner\image2latex\tflib\ops.py:258: The name tf.nn.rnn_cell.RNNCell is deprecated. Please use tf.compat.v1.nn.rnn_cell.RNNCell instead.

W1127 19:42:27.112899 16544 deprecation_wrapper.py:119] From c:\scanner\image2latex\predict.py:23: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

W1127 19:42:27.169785 16544 deprecation_wrapper.py:119] From c:\scanner\image2latex\tflib\ops.py:245: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

Traceback (most recent call last):
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 1864, in _create_c_op
c_op = c_api.TF_FinishOperation(op_desc)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Depth of input (32) is not a multiple of input depth of filter (64) for 'conv2/Conv2D' (op: 'Conv2D') with input shapes: [?,?,?,32], [3,3,64,64].

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\scanner\image2latex\predict.py", line 31, in
ctx = tflib.network.im2latex_cnn(X,NUM_FEATS_START,True)
File "c:\scanner\image2latex\tflib\network.py", line 79, in im2latex_cnn
X = tf.nn.relu(tflib.ops.conv2d('conv2', X, 3, 1, num_feats, num_feats, pad = 'SAME', bias=False))
File "c:\scanner\image2latex\tflib\ops.py", line 203, in conv2d
out = tf.nn.conv2d(input,filters=filters, strides=[1, 1, stride, stride], padding=pad, data_format='NHWC')
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\nn_ops.py", line 1953, in conv2d
name=name)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\gen_nn_ops.py", line 1160, in conv2d
data_format=data_format, dilations=dilations, name=name)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\util\deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 3616, in create_op
op_def=op_def)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 2027, in init
control_input_ops)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 1867, in _create_c_op
raise ValueError(str(e))
ValueError: Depth of input (32) is not a multiple of input depth of filter (64) for 'conv2/Conv2D' (op: 'Conv2D') with input shapes: [?,?,?,32], [3,3,64,64].

(base) C:\Users\Sarthak>python -u "c:\scanner\image2latex\predict.py"
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
WARNING: Logging before flag parsing goes to stderr.
W1127 19:43:06.639282 15456 configdefaults.py:515] g++ not available, if using conda: conda install m2w64-toolchain
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\theano\configdefaults.py:560: UserWarning: DeprecationWarning: there is no c++ compiler.This is deprecated and with Theano 0.11 a c++ compiler will be mandatory
warnings.warn("DeprecationWarning: there is no c++ compiler."
W1127 19:43:06.650255 15456 configdefaults.py:580] g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
W1127 19:43:07.080190 15456 blas_headers.py:988] Using NumPy C-API based implementation for BLAS functions.
W1127 19:43:07.251765 15456 deprecation_wrapper.py:119] From c:\scanner\image2latex\tflib\ops.py:258: The name tf.nn.rnn_cell.RNNCell is deprecated. Please use tf.compat.v1.nn.rnn_cell.RNNCell instead.

W1127 19:43:07.301639 15456 deprecation_wrapper.py:119] From c:\scanner\image2latex\predict.py:23: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

W1127 19:43:07.359498 15456 deprecation_wrapper.py:119] From c:\scanner\image2latex\tflib\ops.py:245: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

W1127 19:43:08.680222 15456 lazy_loader.py:50]
The TensorFlow contrib module will not be included in TensorFlow 2.0.
For more information, please see:

Traceback (most recent call last):
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 1864, in _create_c_op
c_op = c_api.TF_FinishOperation(op_desc)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Depth of input (128) is not a multiple of input depth of filter (256) for 'conv5/Conv2D' (op: 'Conv2D') with input shapes: [?,?,?,128], [3,3,256,512].

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\scanner\image2latex\predict.py", line 31, in
ctx = tflib.network.im2latex_cnn(X,NUM_FEATS_START,True)
File "c:\scanner\image2latex\tflib\network.py", line 87, in im2latex_cnn
X = tf.nn.relu(tflib.ops.conv2d('conv5', X, 3, 1, num_feats4, num_feats8, batchnorm=bn, is_training=train_mode, pad = 'SAME', bias=False))
File "c:\scanner\image2latex\tflib\ops.py", line 203, in conv2d
out = tf.nn.conv2d(input,filters=filters, strides=[1, 1, stride, stride], padding=pad, data_format='NHWC')
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\nn_ops.py", line 1953, in conv2d
name=name)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\gen_nn_ops.py", line 1160, in conv2d
data_format=data_format, dilations=dilations, name=name)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\util\deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 3616, in create_op
op_def=op_def)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 2027, in init
control_input_ops)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 1867, in _create_c_op
raise ValueError(str(e))
ValueError: Depth of input (128) is not a multiple of input depth of filter (256) for 'conv5/Conv2D' (op: 'Conv2D') with input shapes: [?,?,?,128], [3,3,256,512].

(base) C:\Users\Sarthak>python -u "c:\scanner\image2latex\predict.py"
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
WARNING: Logging before flag parsing goes to stderr.
W1127 19:43:39.413293 15844 configdefaults.py:515] g++ not available, if using conda: conda install m2w64-toolchain
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\theano\configdefaults.py:560: UserWarning: DeprecationWarning: there is no c++ compiler.This is deprecated and with Theano 0.11 a c++ compiler will be mandatory
warnings.warn("DeprecationWarning: there is no c++ compiler."
W1127 19:43:39.424278 15844 configdefaults.py:580] g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
W1127 19:43:39.838238 15844 blas_headers.py:988] Using NumPy C-API based implementation for BLAS functions.
W1127 19:43:40.012807 15844 deprecation_wrapper.py:119] From c:\scanner\image2latex\tflib\ops.py:258: The name tf.nn.rnn_cell.RNNCell is deprecated. Please use tf.compat.v1.nn.rnn_cell.RNNCell instead.

W1127 19:43:40.063678 15844 deprecation_wrapper.py:119] From c:\scanner\image2latex\predict.py:23: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

W1127 19:43:40.124533 15844 deprecation_wrapper.py:119] From c:\scanner\image2latex\tflib\ops.py:245: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

W1127 19:43:41.438272 15844 lazy_loader.py:50]
The TensorFlow contrib module will not be included in TensorFlow 2.0.
For more information, please see:

W1127 19:43:41.997882 15844 deprecation.py:323] From c:\scanner\image2latex\tflib\ops.py:411: bidirectional_dynamic_rnn (from tensorflow.python.ops.rnn) is deprecated and will be removed in a future version.
Instructions for updating:
Please use keras.layers.Bidirectional(keras.layers.RNN(cell)), which is equivalent to this API
W1127 19:43:41.999880 15844 deprecation.py:323] From C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\rnn.py:464: dynamic_rnn (from tensorflow.python.ops.rnn) is deprecated and will be removed in a future version.
Instructions for updating:
Please use keras.layers.RNN(cell), which is equivalent to this API
Traceback (most recent call last):
File "c:\scanner\image2latex\predict.py", line 32, in
out,state = tflib.ops.im2latexAttention('AttLSTM',emb_seqs,ctx,EMB_DIM,ENC_DIM,DEC_DIM,D,H,W)
File "c:\scanner\image2latex\tflib\ops.py", line 541, in im2latexAttention
V_cap = tf.scan(fn,tf.range(tf.shape(V)[1]), initializer=tf.placeholder(shape=(None,None,2*ENC_DIM),dtype=tf.float32))
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\functional_ops.py", line 505, in scan
maximum_iterations=n)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\control_flow_ops.py", line 3501, in while_loop
return_same_structure)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\control_flow_ops.py", line 3012, in BuildLoop
pred, body, original_loop_vars, loop_vars, shape_invariants)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\control_flow_ops.py", line 2937, in _BuildLoop
body_result = body(*packed_vars_for_body)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\control_flow_ops.py", line 3456, in
body = lambda i, lv: (i + 1, orig_body(*lv))
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\functional_ops.py", line 482, in compute
a_out = fn(packed_a, packed_elems)
File "c:\scanner\image2latex\tflib\ops.py", line 539, in fn
return tflib.ops.BiLSTM(name+'.BiLSTMEncoder',V[:,i],D,ENC_DIM,h0_i_1[:,i],h0_i_2[:,i])
File "c:\scanner\image2latex\tflib\ops.py", line 411, in BiLSTM
outputs = tf.nn.bidirectional_dynamic_rnn(cell1, cell2, inputs, sequence_length=seq_len, initial_state_fw=h0_1, initial_state_bw=h0_2)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\util\deprecation.py", line 324, in new_func
return func(*args, **kwargs)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\rnn.py", line 464, in bidirectional_dynamic_rnn
scope=fw_scope)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\util\deprecation.py", line 324, in new_func
return func(*args, **kwargs)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\rnn.py", line 707, in dynamic_rnn
dtype=dtype)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\rnn.py", line 781, in _dynamic_rnn_loop
"Input size (depth of inputs) must be accessible via shape inference,"
ValueError: Input size (depth of inputs) must be accessible via shape inference, but saw value None.

(base) C:\Users\Sarthak>python -u "c:\scanner\image2latex\predict.py"
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
WARNING: Logging before flag parsing goes to stderr.
W1128 01:03:32.984935 2240 configdefaults.py:515] g++ not available, if using conda: conda install m2w64-toolchain
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\theano\configdefaults.py:560: UserWarning: DeprecationWarning: there is no c++ compiler.This is deprecated and with Theano 0.11 a c++ compiler will be mandatory
warnings.warn("DeprecationWarning: there is no c++ compiler."
W1128 01:03:33.014869 2240 configdefaults.py:580] g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
W1128 01:03:34.820028 2240 blas_headers.py:988] Using NumPy C-API based implementation for BLAS functions.
W1128 01:03:35.324705 2240 deprecation_wrapper.py:119] From c:\scanner\image2latex\tflib\ops.py:258: The name tf.nn.rnn_cell.RNNCell is deprecated. Please use tf.compat.v1.nn.rnn_cell.RNNCell instead.

W1128 01:03:36.316025 2240 deprecation_wrapper.py:119] From c:\scanner\image2latex\predict.py:23: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

W1128 01:03:36.379881 2240 deprecation_wrapper.py:119] From c:\scanner\image2latex\tflib\ops.py:245: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

Traceback (most recent call last):
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 1864, in _create_c_op
c_op = c_api.TF_FinishOperation(op_desc)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Depth of input (32) is not a multiple of input depth of filter (64) for 'conv2/Conv2D' (op: 'Conv2D') with input shapes: [?,?,?,32], [3,3,64,128].

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\scanner\image2latex\predict.py", line 31, in
ctx = tflib.network.im2latex_cnn(X,NUM_FEATS_START,True)
File "c:\scanner\image2latex\tflib\network.py", line 79, in im2latex_cnn
X = tf.nn.relu(tflib.ops.conv2d('conv2', X, 3, 1, num_feats, num_feats*2, pad = 'SAME', bias=False))
File "c:\scanner\image2latex\tflib\ops.py", line 203, in conv2d
out = tf.nn.conv2d(input,filters=filters, strides=[1, 1, stride, stride], padding=pad, data_format='NHWC')
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\nn_ops.py", line 1953, in conv2d
name=name)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\gen_nn_ops.py", line 1160, in conv2d
data_format=data_format, dilations=dilations, name=name)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\util\deprecation.py", line 507, in new_func
return func(*args, **kwargs)

(base) C:\Users\Sarthak>python -u "c:\scanner\image2latex\predict.py"
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
WARNING: Logging before flag parsing goes to stderr.
W1128 01:15:01.867676 17600 configdefaults.py:515] g++ not available, if using conda: conda install m2w64-toolchain
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\theano\configdefaults.py:560: UserWarning: DeprecationWarning: there is no c++ compiler.This is deprecated and with Theano 0.11 a c++ compiler will be mandatory
warnings.warn("DeprecationWarning: there is no c++ compiler."
W1128 01:15:01.891614 17600 configdefaults.py:580] g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
W1128 01:15:03.140272 17600 blas_headers.py:988] Using NumPy C-API based implementation for BLAS functions.
W1128 01:15:03.627967 17600 deprecation_wrapper.py:119] From c:\scanner\image2latex\tflib\ops.py:258: The name tf.nn.rnn_cell.RNNCell is deprecated. Please use tf.compat.v1.nn.rnn_cell.RNNCell instead.

W1128 01:15:04.468720 17600 deprecation_wrapper.py:119] From c:\scanner\image2latex\predict.py:23: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

W1128 01:15:04.606352 17600 deprecation_wrapper.py:119] From c:\scanner\image2latex\tflib\ops.py:245: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

(base) C:\Users\Sarthak>python -u "c:\scanner\image2latex\predict.py"
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
WARNING: Logging before flag parsing goes to stderr.
W1128 01:15:43.846421 10204 configdefaults.py:515] g++ not available, if using conda: conda install m2w64-toolchain
C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\theano\configdefaults.py:560: UserWarning: DeprecationWarning: there is no c++ compiler.This is deprecated and with Theano 0.11 a c++ compiler will be mandatory
warnings.warn("DeprecationWarning: there is no c++ compiler."
W1128 01:15:43.850411 10204 configdefaults.py:580] g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.
W1128 01:15:44.360051 10204 blas_headers.py:988] Using NumPy C-API based implementation for BLAS functions.
W1128 01:15:44.552536 10204 deprecation_wrapper.py:119] From c:\scanner\image2latex\tflib\ops.py:258: The name tf.nn.rnn_cell.RNNCell is deprecated. Please use tf.compat.v1.nn.rnn_cell.RNNCell instead.

W1128 01:15:44.609384 10204 deprecation_wrapper.py:119] From c:\scanner\image2latex\predict.py:23: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.

W1128 01:15:44.767959 10204 deprecation_wrapper.py:119] From c:\scanner\image2latex\tflib\ops.py:245: The name tf.nn.max_pool is deprecated. Please use tf.nn.max_pool2d instead.

Traceback (most recent call last):
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 1864, in _create_c_op
c_op = c_api.TF_FinishOperation(op_desc)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Depth of input (32) is not a multiple of input depth of filter (64) for 'conv2/Conv2D' (op: 'Conv2D') with input shapes: [?,?,?,32], [3,3,64,128].

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\scanner\image2latex\predict.py", line 31, in
ctx = tflib.network.im2latex_cnn(X,NUM_FEATS_START,True)
File "c:\scanner\image2latex\tflib\network.py", line 79, in im2latex_cnn
X = tf.nn.relu(tflib.ops.conv2d('conv2', X, 3, 1, num_feats, num_feats*2, pad = 'SAME', bias=False))
File "c:\scanner\image2latex\tflib\ops.py", line 203, in conv2d
out = tf.nn.conv2d(input,filters=filters, strides=[1, 1, stride, stride], padding=pad, data_format='NHWC')
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\nn_ops.py", line 1953, in conv2d
name=name)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\ops\gen_nn_ops.py", line 1160, in conv2d
data_format=data_format, dilations=dilations, name=name)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\op_def_library.py", line 788, in _apply_op_helper
op_def=op_def)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\util\deprecation.py", line 507, in new_func
return func(*args, **kwargs)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 3616, in create_op
op_def=op_def)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 2027, in init
control_input_ops)
File "C:\Users\Sarthak\AppData\Roaming\Python\Python36\site-packages\tensorflow\python\framework\ops.py", line 1867, in _create_c_op
raise ValueError(str(e))
ValueError: Depth of input (32) is not a multiple of input depth of filter (64) for 'conv2/Conv2D' (op: 'Conv2D') with input shapes: [?,?,?,32], [3,3,64,128].

Please help me resolve this issue ,
Thanks

@StephenKyung
Copy link

in tflib\ops.py
lin3 238

return tf.nn.max_pool(l_input, ksize=[1, 1, k1, k2], strides=[1, 1, s1, s2],
                      padding='SAME', name=name, data_format='NCHW')

should be changed

return tf.nn.max_pool(l_input, ksize=[1, k1, k2, 1], strides=[1, s1, s2, 1],
                      padding='SAME', name=name, data_format='NHWC')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants