-
Notifications
You must be signed in to change notification settings - Fork 22
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 "pad" param is float which unaccept in caffe #5
Comments
Hi! |
i create a wide residual net,with depth 16,width 8,except the "pad" param,i find it will be some problem in average_pooling2d layer,it is signed in this project's readme file,so i delete the average_pooling2d layer.but when convert the weights to caffemodel file,some layer get unsuitable shape.i could not find why. |
What is kernel size, stride, input and output shape in your average_pooling2d layer? |
Hi, I'm having the same problem with a keras squeezenet, any idea on how to solve it? |
@marianogaragiola, what implementation of Squeezenet are you using? |
Is the keras_squeezenet version. I solved the problem casting to int the value of the variable, seems to working fine but I'm not so sure is the correct way to do it. |
@marianogaragiola I had modified the padding calculation, it should work properly now |
Ok, thanks. I will use the new version and test it. |
hello uhfband,thanks for your work.when i run the convert_VGG16 demo,i got the error:
File "/media/ireqhawk/文件/ireqhawk/project/AdienceDBClassfi/AdienceDBClassfi/demo.py", line 184, in <module> main() File "/media/ireqhawk/文件/ireqhawk/project/AdienceDBClassfi/AdienceDBClassfi/demo.py", line 147, in main keras2caffe.convert(keras_model, 'VGG16.prototxt', 'VGG16.caffemodel') File "/media/ireqhawk/文件/ireqhawk/project/AdienceDBClassfi/AdienceDBClassfi/keras2caffe/convert.py", line 375, in convert net_proto = input_str + '\n' + 'layer {' + 'layer {'.join(str(caffe_net.to_proto()).split('layer {')[2:]) File "/home/ireqhawk/bin/caffe/python/caffe/net_spec.py", line 193, in to_proto top._to_proto(layers, names, autonames) File "/home/ireqhawk/bin/caffe/python/caffe/net_spec.py", line 96, in _to_proto return self.fn._to_proto(layers, names, autonames) File "/home/ireqhawk/bin/caffe/python/caffe/net_spec.py", line 159, in _to_proto _param_names[self.type_name] + '_param'), k, v) File "/home/ireqhawk/bin/caffe/python/caffe/net_spec.py", line 73, in assign_proto getattr(proto, name).extend(val) TypeError: 1.5 has type float, but expected one of: int, long
it becuase the convert code cal a float "pad" param,if i just fllor the pad val,i will got uneuqal shape on save caffemodel,any advise.
my enviroment:
caffe 1.0.0
keras 2.1.2
tensorflow 1.4.1
thank you!
The text was updated successfully, but these errors were encountered: