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

The 1st entry of padding argument must be a tuple of 2 integers. Received: 3 #5

Open
mrlzla opened this issue Aug 24, 2017 · 1 comment

Comments

@mrlzla
Copy link

mrlzla commented Aug 24, 2017

python -m caffe2keras deploy_google_64.prototxt trained_google_64_v01_iter_8000.caffemodel keras-output-model.h5
Using Theano backend.
Converting model...
CREATING MODEL
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/vladik/ml/caffe2keras/caffe2keras/main.py", line 32, in
main()
File "/home/vladik/ml/caffe2keras/caffe2keras/main.py", line 22, in main
model = convert.caffe_to_keras(args.prototxt, args.caffemodel, args.debug)
File "caffe2keras/convert.py", line 358, in caffe_to_keras
tuple(config.input_dim[1:]))
File "caffe2keras/convert.py", line 471, in create_model
out_blobs = converter(layer, layer_bottom_blobs)
File "caffe2keras/convert.py", line 53, in wrapper
rv = converter_func(spec, bot_arg)
File "caffe2keras/convert.py", line 118, in handle_conv
data_format='channels_first')(bottom)
File "/usr/local/lib/python2.7/dist-packages/keras/legacy/interfaces.py", line 87, in wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/keras/layers/convolutional.py", line 1306, in init
'1st entry of padding')
File "/usr/local/lib/python2.7/dist-packages/keras/utils/conv_utils.py", line 30, in normalize_tuple
str(n) + ' integers. Received: ' + str(value))
ValueError: The 1st entry of padding argument must be a tuple of 2 integers. Received: 3

@qxcv
Copy link
Owner

qxcv commented Aug 27, 2017

Hmm, looks like a similar problem to #2 (although this time it's actually the code in this repo…). Converting the width and height in handle_conv to ints should fix the problem for good, but in the mean time, running on Python 3 should make it work.

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