We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm using the script https://github.com/FluxML/Metalhead.jl/blob/master/scripts/port_torchvision.jl to load torchvision's models and copy their weights into Metalhead's ones.
With vggX model all is fine.
With resnets instead I get the following mismatchs:
flux_key = "model.layers[1].layers[3].layers[1].layers[1].layers[1].conv_weight" size(flux_param) = (1, 1, 64, 128) pytorch_key = "layer2.0.conv1.weight" size(pytorch_param) = (3, 3, 64, 128)
flux_key = "model.layers[1].layers[2].layers[1].layers[1].layers[1].conv_weight" size(flux_param) = (1, 1, 64, 256) pytorch_key = "layer1.0.conv1.weight" size(pytorch_param) = (1, 1, 64, 64)
The text was updated successfully, but these errors were encountered:
It's because Parallel gives the layers in a different order than the one in torchvision. Enumerating over reverse(node.layers) at
Parallel
reverse(node.layers)
Metalhead.jl/scripts/pytorch2flux.jl
Line 79 in e3a82ff
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
I'm using the script
https://github.com/FluxML/Metalhead.jl/blob/master/scripts/port_torchvision.jl
to load torchvision's models and copy their weights into Metalhead's ones.
With vggX model all is fine.
With resnets instead I get the following mismatchs:
The text was updated successfully, but these errors were encountered: