Code Monkey home page Code Monkey logo

model_constructor's Issues

MC init.

Use validator instead of init.

The dw and se parameter is breaking FastAI compatibility

Hi there,
great Job on achieving such great results on the imagewoof dataset and thank you for sharing your code! ๐Ÿ™‚

I noticed that currently your Notebooks are not running anymore. I assume the issue is some incompability with a newver version of fastai.

Just removing the dw and se parameter from net.py fixes the error but I am unsure about the side effects. I'll open a pull request to show you which part I mean.

This is the trace:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-9-323bb61e297c> in <module>
      3 for e in [5]*5 + [20]*5 + [80]:
      4   mixup=0 if e<=20 else 0.2
----> 5   learn = get_learn(model=model, size=128, bs=16, mixup=mixup)
      6   learn.fit_fc(e, lr=4e-3, moms=(0.95,0.95), start_pct=0.72)
      7   acc = learn.recorder.metrics[-1][0].item()

E:\anaconda\envs\fastai\lib\site-packages\imagenette_experiments\train_utils.py in get_learn(gpu, woof, size, alpha, mom, eps, bs, mixup, opt, sa, sym, model, use_gc)
    224 
    225     data = get_data(size, woof, bs)
--> 226     learn = (Learner(data, model(), wd=1e-2, opt_func=opt_func,
    227              metrics=[accuracy,top_k_accuracy],
    228              bn_wd=False, true_wd=True,

E:\anaconda\envs\fastai\lib\site-packages\model_constructor\net.py in __call__(self)
    188         model = nn.Sequential(OrderedDict([
    189             ('stem', self.stem),
--> 190             ('body', self.body),
    191             ('head', self.head)]))
    192         self._init_cnn(model)

E:\anaconda\envs\fastai\lib\site-packages\model_constructor\net.py in body(self)
    183     @property
    184     def body(self):
--> 185         return self._make_body(self)
    186 
    187     def __call__(self):

E:\anaconda\envs\fastai\lib\site-packages\model_constructor\net.py in _make_body(self)
    127                                           blocks=l, stride=1 if i == 0 else 2,
    128                                           sa=self.sa if i == 0 else False))
--> 129               for i, l in enumerate(self.layers)]
    130     return nn.Sequential(OrderedDict(blocks))
    131 

E:\anaconda\envs\fastai\lib\site-packages\model_constructor\net.py in <listcomp>(.0)
    127                                           blocks=l, stride=1 if i == 0 else 2,
    128                                           sa=self.sa if i == 0 else False))
--> 129               for i, l in enumerate(self.layers)]
    130     return nn.Sequential(OrderedDict(blocks))
    131 

E:\anaconda\envs\fastai\lib\site-packages\model_constructor\net.py in _make_layer(self, expansion, ni, nf, blocks, stride, sa)
    118                                      zero_bn=self.zero_bn, bn_1st=self.bn_1st, groups=self.groups,
    119                                      dw=self.dw, se=self.se))
--> 120               for i in range(blocks)]
    121     return nn.Sequential(OrderedDict(layers))
    122 

E:\anaconda\envs\fastai\lib\site-packages\model_constructor\net.py in <listcomp>(.0)
    118                                      zero_bn=self.zero_bn, bn_1st=self.bn_1st, groups=self.groups,
    119                                      dw=self.dw, se=self.se))
--> 120               for i in range(blocks)]
    121     return nn.Sequential(OrderedDict(layers))
    122 

E:\anaconda\envs\fastai\lib\site-packages\fastai\core.py in _init(self, *args, **kwargs)
     64         def _init(self,*args,**kwargs):
     65             self.__pre_init__()
---> 66             old_init(self, *args,**kwargs)
     67             self.__post_init__()
     68         x.__init__ = _init

TypeError: __init__() got an unexpected keyword argument 'dw'
```

Model name

Set model name - as name from MC or MC class name.

Typing

Check typing at MC and layers.

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.