Legacy.nn (torch7 model) has error when model.updateParameters()

I loaded a torch7 model into pytorch. I try doing model.updateParameters(0.1) to update parameters of the model (which is a typical CNN). I get an hour like below, any ideas of why?


TypeError Traceback (most recent call last)
in ()
62
63
β€”> 64 tissue_fate_3d.updateParameters(0.01)
65
66 # get the parameter and gradients (faltten version)

/usr/local/lib/python2.7/dist-packages/torch/legacy/nn/Container.pyc in updateParameters(self, learningRate)
30
31 def updateParameters(self, learningRate):
β€”> 32 self.applyToModules(lambda m: m.updateParameters(learningRate))
33
34 def training(self):

/usr/local/lib/python2.7/dist-packages/torch/legacy/nn/Container.pyc in applyToModules(self, func)
24 def applyToModules(self, func):
25 for module in self.modules:
β€”> 26 func(module)
27
28 def zeroGradParameters(self):

/usr/local/lib/python2.7/dist-packages/torch/legacy/nn/Container.pyc in (m)
30
31 def updateParameters(self, learningRate):
β€”> 32 self.applyToModules(lambda m: m.updateParameters(learningRate))
33
34 def training(self):

/usr/local/lib/python2.7/dist-packages/torch/legacy/nn/Module.pyc in updateParameters(self, learningRate)
77
78 def updateParameters(self, learningRate):
β€”> 79 params, gradParams = self.parameters()
80 if params:
81 for p, gp in zip(params, gradParams):

TypeError: β€˜NoneType’ object is not iterable

2 Likes

I have the same problem. Did you solve it?