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

Questions about reading pretrain model weights in nngraph #141

Open
xieshuqin opened this issue Apr 1, 2017 · 1 comment
Open

Questions about reading pretrain model weights in nngraph #141

xieshuqin opened this issue Apr 1, 2017 · 1 comment

Comments

@xieshuqin
Copy link

hi there

I try to use a pretrain model to initial my own model's weight. Both of them are nngraph and the network structures are almost the same. I expect after the initialization, they should have the same outputs. After copying the weights, I forward both network with the same random input, but the outputs are different. I am sure that I have correctly copy the weights from one to another. This is done by calling "torch.sum(torch.ne(param1, param2))" where the param1, param2 are the parameters of the two network. The outputs are different after they forward nn.SpatialBatchNormaliztion. I am sure that the params in nn.SpatialBatchNormalization are the same. Is there any way to fix this? Or Is there a better way to directly modify the structure of a 'nngraph' model?

@arthitag
Copy link

arthitag commented Jul 5, 2017

Hi @xieshuqin , I am facing the exact same issue.
Did you figure out why the BatchNorm layer acts so weird?
Please share. Thanks!

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

2 participants