Giter Site home page Giter Site logo

About #Parameters in the model about swinir HOT 4 OPEN

prateek-77 avatar prateek-77 commented on May 3, 2024 1
About #Parameters in the model

from swinir.

Comments (4)

JingyunLiang avatar JingyunLiang commented on May 3, 2024 1

#Params: use

 print({sum(map(lambda x: x.numel(), model.parameters())):,d})

# FLOPS: refer to

print(height, width, model.flops() / 1e9)

from swinir.

prateek-77 avatar prateek-77 commented on May 3, 2024

Thanks for the suggestions! The #Flops for the lightweight SwinIR model are matching, however, the #Params are not. It's coming out to be around 910.2K.

I'm using the following model config for lightweight-SwinIR:

height = (1024 // upscale // window_size + 1) * window_size
width = (720 // upscale // window_size + 1) * window_size
model = SwinIR(upscale=2, in_chans=3, img_size=(height, width), window_size=8,
                    img_range=1., depths=[6, 6, 6, 6], embed_dim=60, num_heads=[6, 6, 6, 6],
                    mlp_ratio=2, upsampler='pixelshuffledirect', resi_connection='1conv')

Also, I'm not able to use model.flops() with classic image SR models, since flop calculation is not defined for the Upsample class.

Can you please provide help with these queries? Thanks a lot!

from swinir.

Auth0rM0rgan avatar Auth0rM0rgan commented on May 3, 2024

Im facing the same thing. The number of network parameters is 910K!

from swinir.

rami0205 avatar rami0205 commented on May 3, 2024

I found that #params in paper excludes "relative_position_bias_table" parameters. These parameters should be included in #params. But this code print({sum(map(lambda x: x.numel(), model.parameters())):,d}) produces right #params that includes "relative_position_bias_table". I think it should be corrected in your paper.

from swinir.

Related Issues (20)

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.