を持っていない私は、ナバナネオンとfpropをやろうとしているが、しかし、私は次のエラーを取得する:ナバナネオンはAttributeError:私はモデルfpropを実行するために行くときに「NoneType」オブジェクトが属性「sizeI」
AttributeError: 'NoneType' object has no attribute 'sizeI'
私は非常に近いfpropの例に従っています。私は彼らのImageLoader
を使ってモデルを訓練しましたが、今はシステムでその結果を利用したいと思います。私はmodel.get_outputs(ArrayIterator(myData))
を使用しようとしましたが、それでも問題はありません。何かご意見は? layer
オブジェクトの属性sizeI
逆参照layer
がNone
あるときに、あなたのスタックトレースに後方の作業
xdev = np.zeros((3 * 224 * 224, batch_size), dtype=np.float32)
xbuf = np.zeros((3 * 224 * 224, batch_size), dtype=np.float32)
img = to_neon(new_img) # function to flatten image to (3 * 224 * 224,)
xbuf[:,0] = img[:, 0]
model = model.load_params("/path/to/params.p")
out = model.fprop(xdev)
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-35-fc650f5dcbc4> in <module>()
----> 1 out = model.fprop(xdev)
/root/neon/neon/models/model.pyc in fprop(self, x, inference)
213 Tensor: the output of the final layer in the model
214 """
--> 215 return self.layers.fprop(x, inference)
216
217 def bprop(self, delta):
/root/neon/neon/layers/container.pyc in fprop(self, inputs, inference, beta)
248 x = l.fprop(x, inference, beta=beta)
249 else:
--> 250 x = l.fprop(x, inference)
251
252 if inference:
/root/neon/neon/layers/layer.pyc in fprop(self, inputs, inference, beta)
787 self.inputs = inputs
788 self.be.fprop_conv(self.nglayer, inputs, self.W, self.outputs, beta=beta,
--> 789 bsum=self.batch_sum)
790 return self.outputs
791
/root/neon/neon/backends/nervanagpu.pyc in fprop_conv(self, layer, I, F, O, X, bias, bsum, alpha, beta, relu, brelu, slope, repeat)
1936 repeat: used in benchmarking
1937 """
-> 1938 assert layer.sizeI == I.size
1939 assert layer.sizeF == F.size
1940 assert layer.sizeO == O.size
AttributeError: 'NoneType' object has no attribute 'sizeI'
'None.size' - yupはそれを持っていません。 – user2864740