-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Transposed dimisions for vgg when loading weights of conv layers #180
Comments
We're trying to match the original VGG network, not transposing filters on purpose, so if that's indeed the case, it's a bug and should be fixed. Though I think the code in
On the other hand, TensorFlow expects weights in [H, W, Cin, Cout] order, according to tf.nn.conv2d docs:
So to convert from MatConvNet format to TensorFlow format, we transpose the 0th and 1st indices with |
Closing due to inactivity, feel free to open if there's anything new. |
For loading pretrained vgg model. i think the weight matrix for conv layers is [H, W, Cin, Cout].
The codes says the pretrained model has the matrix of [W, H, Cin, Cout], so it transposed it.
Because i've used the same pretrained model to build the original vgg net and evaluated it. It turns out that if you use [H, W, Cin, Cout] to load the model, the effect is better than the [W, H, Cin, Cout] version.
So i want to ask why we are transposing the [H, W]. Or any motivation to do this.
The text was updated successfully, but these errors were encountered: