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

Error when converting inception-v4 from caffe to tensorflow #26

seanchung2 opened this issue Dec 21, 2017 · 1 comment

Error when converting inception-v4 from caffe to tensorflow #26

seanchung2 opened this issue Dec 21, 2017 · 1 comment


Copy link


This is my model: link
When I tried to convert it from IR to tensorflow, an error popped out:

Traceback (most recent call last):
  File "/usr/lib/python2.7/", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/", line 72, in _run_code
    exec code in run_globals
  File "/usr/local/lib/python2.7/dist-packages/mmdnn/conversion/examples/tensorflow/", line 68, in <module>
    tester = TestTF()
  File "/usr/local/lib/python2.7/dist-packages/mmdnn/conversion/examples/tensorflow/", line 17, in __init__
    self.input, self.model = self.MainModel.KitModel(self.args.w)
  File "", line 57, in KitModel
    inception_stem2_7x1_pad = tf.pad(inception_stem2_1x7_relu, paddings = [[0L, 0L], [3L, 3L], [3L, -3L], [0L, 0L]])
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/", line 1735, in pad
    result = gen_array_ops._pad(tensor, paddings, name=name)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/", line 2927, in _pad
    "Pad", input=input, paddings=paddings, name=name)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/", line 787, in _apply_op_helper
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/", line 2958, in create_op
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/", line 2209, in set_shapes_for_outputs
    shapes = shape_func(op)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/", line 2159, in call_with_requiring
    return call_cpp_shape_fn(op, require_shape_fn=True)
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/", line 627, in call_cpp_shape_fn
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/", line 691, in _call_cpp_shape_fn_impl
    raise ValueError(err.message)
ValueError: Paddings must be non-negative for 'Pad_4' (op: 'Pad') with input shapes: [?,73,73,64], [4,2] and with computed input tensors: input[1] = <[0 0][3 3][3 -3][0 0]>.

Does it mean this model is impossible to convert?
Or is there any wrong with the model?

Thank you.

Copy link

kitstar commented Dec 21, 2017

Hi @seanchung2 ,

Fixed. Thanks very much.

@kitstar kitstar assigned kitstar and unassigned TobeyQin Dec 21, 2017
@kitstar kitstar closed this as completed Dec 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

3 participants