Git Product home page Git Product logo

Comments (2)

gasharper avatar gasharper commented on June 10, 2024

目前仓库给出的代码貌似不是最新版本。
第一个解决方案是忽略形状不匹配的权重,然后强制替换权重。
第二个解决方案是可以在训练过程保存下.pt文件,然后推理过程中加载。

from pyramidflow.

pribadihcr avatar pribadihcr commented on June 10, 2024

@gasharper

I tried second solution. save the pth but when loaded it still has the mismath

raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for PyramidFlow:
	size mismatch for nf.moduleslst.0.affineParams.norm.running_mean: copying a param with shape torch.Size([1, 1, 128, 128]) from checkpoint, the shape in current model is torch.Size([1, 1, 1, 1]).
	size mismatch for nf.moduleslst.1.affineParams.norm.running_mean: copying a param with shape torch.Size([1, 1, 64, 64]) from checkpoint, the shape in current model is torch.Size([1, 1, 1, 1]).
	size mismatch for nf.moduleslst.2.affineParams.norm.running_mean: copying a param with shape torch.Size([1, 1, 256, 256]) from checkpoint, the shape in current model is torch.Size([1, 1, 1, 1]).
	size mismatch for nf.moduleslst.3.affineParams.norm.running_mean: copying a param with shape torch.Size([1, 1, 64, 64]) from checkpoint, the shape in current model is torch.Size([1, 1, 1, 1]).
	size mismatch for nf.moduleslst.4.affineParams.norm.running_mean: copying a param with shape torch.Size([1, 1, 128, 128]) from checkpoint, the shape in current model is torch.Size([1, 1, 1, 1]).
	size mismatch for nf.moduleslst.5.affineParams.norm.running_mean: copying a param with shape torch.Size([1, 1, 64, 64]) from checkpoint, the shape in current model is torch.Size([1, 1, 1, 1]).
	size mismatch for nf.moduleslst.6.affineParams.norm.running_mean: copying a param with shape torch.Size([1, 1, 256, 256]) from checkpoint, the shape in current model is torch.Size([1, 1, 1, 1]).
	size mismatch for nf.moduleslst.7.affineParams.norm.running_mean: copying a param with shape torch.Size([1, 1, 64, 64]) from checkpoint, the shape in current model is torch.Size([1, 1, 1, 1]).
	size mismatch for nf.moduleslst.8.affineParams.norm.running_mean: copying a param with shape torch.Size([1, 1, 128, 128]) from checkpoint, the shape in current model is torch.Size([1, 1, 1, 1]).
	size mismatch for nf.moduleslst.9.affineParams.norm.running_mean: copying a param with shape torch.Size([1, 1, 64, 64]) from checkpoint, the shape in current model is torch.Size([1, 1, 1, 1]).
	size mismatch for nf.moduleslst.10.affineParams.norm.running_mean: copying a param with shape torch.Size([1, 1, 256, 256]) from checkpoint, the shape in current model is torch.Size([1, 1, 1, 1]).
	size mismatch for nf.moduleslst.11.affineParams.norm.running_mean: copying a param with shape torch.Size([1, 1, 64, 64]) from checkpoint, the shape in current model is torch.Size([1, 1, 1, 1]).
	size mismatch for nf.moduleslst.12.affineParams.norm.running_mean: copying a param with shape torch.Size([1, 1, 128, 128]) from checkpoint, the shape in current model is torch.Size([1, 1, 1, 1]).
	size mismatch for nf.moduleslst.13.affineParams.norm.running_mean: copying a param with shape torch.Size([1, 1, 64, 64]) from checkpoint, the shape in current model is torch.Size([1, 1, 1, 1]).
	size mismatch for nf.moduleslst.14.affineParams.norm.running_mean: copying a param with shape torch.Size([1, 1, 256, 256]) from checkpoint, the shape in current model is torch.Size([1, 1, 1, 1]).
	size mismatch for nf.moduleslst.15.affineParams.norm.running_mean: copying a param with shape torch.Size([1, 1, 64, 64]) from checkpoint, the shape in current model is torch.Size([1, 1, 1, 1]).


from pyramidflow.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.