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
weights converted in wrong order #31
Comments
@scenarios Seems like a valid point. Can you check #32? Do you have pycaffe installed to test converting the weights again? |
@jmtatsch Checked and everything works well now. |
@scenarios Perfect. Would you be so kind and contribute new npy weights for the models? I don't have the whole PSPNET, pycaffe etc chain running anymore ... |
I think we can safely close this now. |
@jmtatsch yup |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @Vladkryvoruchko , I noticed you convert the parameter of bn layer in caffe to the numpy array by the order of 'mean = v[0], variance = v[1], scale = v[2], offset = v[3]' . However, the v[0-3] actually hold the value for scale, offset, mean, variance respectively according to the caffe blob's definition in bn layer.
The reason that you can still reproduce the results is that you reverse the order again when you try to restore the parameter for the keras model from the numpy array, i.e. model.get_layer(layer.name).set_weights([mean, variance, scale, offset]).
This may not hurt when using your code completely, but it is very unexpected for those people who just use the parameter converted by the code.
Thanks for your efforts!
The text was updated successfully, but these errors were encountered: