Learner.summary() error exit : missing children

Hi all,
I’m trying to run a super-resolution by implementing EDRS following the super-resolution lesson 2018/2019.
When I run learn.summary().
I get this error:
TypeError Traceback (most recent call last)
Cell In[9], line 1

> → 1 learn.summary()
[…]
211 xb = self.dls.train.one_batch()[:getattr(self.dls.train, “n_inp”, 1)]
* → 212 res = module_summary(self, xb)
213 res += f"Optimizer used: {self.opt_func}\nLoss function: {self.loss_func}\n\n"
214 if self.opt is not None:
[…]
in module_summary(learn, *xb)
176 “Print a summary of model using xb
177 #Individual parameters wrapped in ParameterModule aren’t called through the hooks in layer_info,
178 # thus are not counted inside the summary
179 #TODO: find a way to have them counted in param number somehow
* → 180 infos = layer_info(learn, xb)
181 n,bs = 76,find_bs(xb)
182 inp_sz = _print_shapes(apply(lambda x:x.shape, xb), bs)
[…]
in layer_info(learn, *xb)
154 params, trainable = total_params(m)
155 return (type(m).name, params, trainable, shape, same)
→ 157 with Hooks(flatten_model(learn.model), _track) as h:
158 batch = apply(lambda o:o[:1], xb)
159 train_only_cbs = [cb for cb in learn.cbs if hasattr(cb, ‘_only_train_loop’)]
[…]
633 def flatten_model(m):
634 “Return the list of all submodules and parameters of m
→ 635 return sum(map(flatten_model,children_and_parameters(m)),[]) if has_children(m) else [m]
[…]
627 def has_children(m):
→ 628 try: next(m.children())
629 except StopIteration: return False
630 return True

TypeError: children() missing 1 required positional argument: ‘self’

I’m wondering if it’s say I have to flatten the model. eg. the flatten layer is missing

Here my layers classes:

class ResSeq(nn.Module):
def init(self, layers, resScale =1.0):
super().init()
self.resScale = resScale
self.m =nn.Sequential(*layers)

def forward(self, x):
    return x+self.m(x) * self.resScale

class edrs8(nn.Module):
def init(self,nf,scale):
super.init()
features = [conv(imgchnl,flt)] #starting convolution
for i in range(nResBlock):
features.append([resBlock(flt)]) #ResBlock
features +=[conv(nf,nf),pixShuffleBlock(nf,nf,scale),
nn.BatchNorm2d(flt),
conv(flt,4)] #exit of ResBlock and adding pixel shuffle
self.features = nn.Sequential(*features)

Thanks for the help
Davide