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

keras2caffe #1

Closed
yonger001 opened this issue Oct 31, 2018 · 9 comments
Closed

keras2caffe #1

yonger001 opened this issue Oct 31, 2018 · 9 comments

Comments

@yonger001
Copy link

hello,would U like to share the keras2caffe scope U have modified?initial scope lacked a lot of layer,ex:multiply,tanh,merge。。。。waiting your reply and discussion,3Q!

@nerddd
Copy link
Owner

nerddd commented Nov 6, 2018

Updated

@nerddd nerddd closed this as completed Nov 6, 2018
@yonger001
Copy link
Author

@nerddd hi,thank U for your reply,when I test the convert_ssrnet script,there is error as follow:
ValueError: Layer #53 (named "dense_1"), weight <tf.Variable 'dense_1/kernel:0' shape=(250, 3) dtype=float32_ref> has shape (250, 3), but the saved weight has shape (160, 3).
obviously,the shape is different between the saved weights and net, I used the official .h5,Have U test it?

@nerddd
Copy link
Owner

nerddd commented Nov 7, 2018

yeah, because the padding is differenf between tf and caffe , so you need to use the SSR-Net in my repo to change the padding way , retrain the model , use the retrained .h5 to transform . More specific, the SSRNet_model.py is modified , you can check.

@yonger001
Copy link
Author

@nerddd thank U so much!!! would U like to share the .h5 which U have retrained??

@liangheng
Copy link

@nerddd hello
Could you please provide the.h5 file corresponding to caffemodel in your examples folder?
Because I used my training. h5 conversion to caffemodel has problems with calling results. I want to know whether it's the conversion script or the training setup, so I want to compare your.h5

thanks

@nerddd
Copy link
Owner

nerddd commented Aug 1, 2019

@liangheng Sorry, the directory has been cleaned. You can use the script provied to retrain your model and then convert it. Or use #2 to change the source code of caffe.

@liangheng
Copy link

@nerddd Thank you very much .yeah, I have retrained the model using the script you provided and convert it. No errors were reported during the conversion, but when I called caffemodel after the conversion, I couldn't get the right results.And I can make sure I got it the right way, so what could be wrong with the conversion or other

@liangheng
Copy link

@nerddd hello
sorry to bother you again
I found that the best models in keras were very poor after converting to caffemodel using the transformation script you provided. Have you tested the converted caffemodel?
I did the following experiment: I used keras to test that an image could be accurately dated. For the same image, I used the converted caffemodel to load it with python's caffe interface(eg: net = caffe.Net('ssrnet_3_3_3_64_1.0_1.0.prototxt', 'ssrnet_3_3_3_64_1.0_1.0.caffemodel', caffe.TEST)), but could not get the same age, so I suspected that the conversion caused the problem or did I go wrong?
I can't send you an email to tell you my WeChat, could you please send me an email to tell me your contact information
thanks

@liangheng
Copy link

@nerddd I solverd this problem~

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

3 participants