Note that there are some explanatory texts on larger screens.

plurals
  1. POAttributeError: 'NoneType' object has no attribute 'indim'
    primarykey
    data
    text
    <p>I'm working with the package 'pybrain' and trying to build a neural network that will recognize images. The part of analyzing the photo is working very well, but as one who is new to pybrain- I'm not used to working with it. Somehow I keep getting the following error:</p> <pre><code>AttributeError: 'NoneType' object has no attribute 'indim' </code></pre> <p>I've tried to solve this problem like a day or so and still doesn't get it. here's part of my code:</p> <pre><code>target=np.array([[0],[1]]) input=getNumberOfImages("photosAfterAverage/",1,2) ds=SupervisedDataSet(72,1) ds.setField('target',target) ds.setField('input',input) print ds.data net=buildNewNetwork(72,76,1) trainer = BackpropTrainer(net, ds) </code></pre> <p>Assume that input is a 2 dimensional containg each cell 72 cells.</p> <p>Edit: As requested, the whole error:</p> <pre><code>Traceback (most recent call last): File "C:\Users\Eytan\Desktop\Mah\Kids_Painting\pyBrainDiffrenceBetween5GradeAnd2Grade.py", line 53, in &lt;module&gt; trainer = BackpropTrainer(net, ds) File "C:\Python27\pybrain\supervised\trainers\backprop.py", line 35, in __init__ self.setData(dataset) File "C:\Python27\pybrain\supervised\trainers\trainer.py", line 22, in setData assert dataset.indim == self.module.indim AttributeError: 'NoneType' object has no attribute 'indim' </code></pre> <p>It may be helpful to point out that the following code is working:</p> <pre><code>net=buildNetwork(2,500,1) ds=SupervisedDataSet(2,1) input=array([[0,1],[1,3434],[34,65],[40,56]]) target=array([[0],[1],[0],[1]]) ds.setField('input',input) ds.setField('target',target) print ds.data trainer = BackpropTrainer(net, ds) </code></pre> <p>Thanks very much for answering, I found the problem- the right function that should have been used is buildNetwork instead of buildNewNetwork.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload