cgp-cnn
cgp-cnn copied to clipboard
Error when running on Ubuntu 16.04, chainer 3.1.0
I tried to run the code, error is as follow:
Traceback (most recent call last): File "/home/data/luopengting/workplace/python/cgp-cnn-master/cnn_train.py", line 118, in call optimizer.update(model, x, t) File "/home/b3434/anaconda3/envs/chainer/lib/python3.5/site-packages/chainer/optimizer.py", line 534, in update loss = lossfun(*args, **kwds) File "/home/data/luopengting/workplace/python/cgp-cnn-master/cnn_model.py", line 160, in call outputs[nodeID], tmp_num = getattr(self, name)(outputs[self.cgp[nodeID][1]], outputs[self.cgp[nodeID][1]], self.train) File "/home/data/luopengting/workplace/python/cgp-cnn-master/cnn_model.py", line 58, in call x = getattr(self, name)(x, not train) TypeError: call() takes 2 positional arguments but 3 were given gpu_id: 0 , eval: 0.0
can u help me, plz ? thx a lot.
[43, 87, 4.153676, 0.0, 11, [['input', 0, 0], ['concat', 0, 0], ['pool_ave', 0, 0], ['sum', 2, 1], ['ConvBlock64_5', 3, 3], ['concat', 0, 4], ['ConvBlock64_3', 5, 5], ['ConvBlock64_3', 6, 5], ['pool_max', 7, 5], ['ConvBlock128_5', 6, 5], ['concat', 8, 9], ['full', 10, 9]]] gpu_id: 0 , [['input', 0, 0], ['ConvBlock32_3', 0, 0], ['pool_ave', 0, 0], ['sum', 2, 1], ['ConvBlock64_5', 3, 3], ['concat', 0, 4], ['ConvBlock64_3', 5, 5], ['ConvBlock64_3', 6, 5], ['pool_max', 7, 5], ['ConvBlock128_5', 6, 5], ['concat', 8, 9], ['full', 10, 9]] gpu_id: 1 , [['input', 0, 0], ['ConvBlock64_3', 0, 0], ['pool_ave', 0, 0], ['sum', 2, 1], ['ConvBlock64_3', 1, 3], ['ConvBlock64_5', 3, 3], ['concat', 0, 5], ['pool_max', 4, 6], ['pool_ave', 7, 4], ['ConvBlock64_3', 6, 7], ['ConvBlock64_3', 9, 7], ['ConvBlock64_5', 8, 7], ['pool_max', 10, 6], ['concat', 12, 11], ['full', 13, 12]] data split order: [48774 26939 2757 ... 4691 29374 31595] data split order: [48774 26939 2757 ... 4691 29374 31595] train data shape: (45000, 3, 32, 32) test data shape : (5000, 3, 32, 32) train data shape: (45000, 3, 32, 32) test data shape : (5000, 3, 32, 32) GPUID : 0 epoch_num: 50 batchsize: 128 GPUID : 1 epoch_num: 50 batchsize: 128 epoch 1 epoch 1 Traceback (most recent call last): File "/home/l00221575/venvpython35/cgp-cnn-master/cnn_train.py", line 118, in call optimizer.update(model, x, t) File "/home/l00221575/venvpython35/lib/python3.5/site-packages/chainer/optimizer.py", line 650, in update loss = lossfun(*args, **kwds) File "/home/l00221575/venvpython35/cgp-cnn-master/cnn_model.py", line 156, in call outputs[nodeID], tmp_num = getattr(self, name)(outputs[self.cgp[nodeID][1]], self.train) File "/home/l00221575/venvpython35/cgp-cnn-master/cnn_model.py", line 30, in call x = getattr(self, name)(x, not train) TypeError: call() takes 2 positional arguments but 3 were given
I have the same problem,did you solve it? thx~
Thank you for your comment. Which version of Chainer are you using now?
chainer-4.4.0, I just sent you an email. You can reply me here.
gpu_id: 0 , eval: 0.0 [9, 19, 105.9819614, 0.0, 23, [['input', 0, 0], ['ResBlock64_5', 0, 0], ['ResBlock128_3', 0, 0], ['sum', 0, 0], ['ResBlock32_5', 3, 1], ['ResBlock64_3', 2, 3], ['ResBlock64_3', 4, 2], ['ResBlock64_ 3', 6, 1], ['ResBlock64_5', 5, 5], ['pool_ave', 5, 6], ['sum', 1, 7], ['ResBlock32_5', 9, 8], ['pool_ave', 6, 1], ['pool_ave', 8, 10], ['ResBlock64_5', 12, 12], ['ResBlock128_3', 14, 6], ['concat', 13, 10], ['ResBlock64_5', 11, 12], ['ResBlock32_3', 17, 10], ['ResBlock64_5', 16, 12], ['sum', 15, 18], ['sum', 20, 19], ['ResBlock128_3', 21, 19], ['full', 22, 21]]] gpu_id: 0 , [['input', 0, 0], ['ResBlock64_5', 0, 0], ['ResBlock128_3', 0, 0], ['sum', 0, 0], ['ResBlock32_5', 3, 1], ['ResBlock64_3', 2, 3], ['ResBlock64_3', 4, 2], ['ResBlock64_5', 5, 3], ['sum', 1, 6], ['pool_ave', 7, 8], ['ResBlock64_5', 6, 8], ['ResBlock128_3', 10, 6], ['concat', 9, 8], ['ResBlock64_5', 12, 8], ['pool_ave', 11, 12], ['sum', 14, 13], ['ResBlock128_3', 15, 13], [' full', 16, 15]] data split order: [48774 26939 2757 ... 4691 29374 31595] train data shape: (45000, 3, 32, 32) test data shape : (5000, 3, 32, 32) GPUID : 0 epoch_num: 50 batchsize: 128 epoch 1 <class 'chainer.variable.Variable'> Traceback (most recent call last): File "C:\gp\cgp-cnn-master\cnn_train.py", line 118, in call optimizer.update(model, x, t) File "C:\ProgramData\Anaconda3\envs\cgp-cnn-master\lib\site-packages\chainer\optimizer.py", line 680, in update loss = lossfun(*args, **kwds) File "C:\gp\cgp-cnn-master\cnn_model.py", line 167, in call outputs[nodeID], tmp_num = getattr(self, name)(outputs[self.cgp[nodeID][1]], outputs[self.cgp[nodeID][1]], self.train) File "C:\gp\cgp-cnn-master\cnn_model.py", line 64, in call x = getattr(self, name)(x, not train) File "C:\ProgramData\Anaconda3\envs\cgp-cnn-master\lib\site-packages\chainer\link.py", line 242, in call out = forward(*args, **kwargs) TypeError: forward() takes 2 positional arguments but 3 were given
I have some problems when run the code, can you help me?