Skip to content

Questions about reading pretrain model weights in nngraph #141

@xieshuqin

Description

@xieshuqin

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions