numenta / htmresearch

Experimental algorithms. Unsupported.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

running MNIST experiment

breznak opened this issue · comments

I'm trying to run the mnist experiment,

But I get

(env_py)mmm@mmm-U2442:~/nupic/nupic.research/image_test$ python mnist_test.py 
============= Loading training images =================
Traceback (most recent call last):
  File "mnist_test.py", line 223, in <module>
    trainNetwork(net)
  File "mnist_test.py", line 106, in trainNetwork
    sensor.executeCommand(["loadMultipleImages", "mnist/training"])
  File "/home/mmm/nupic/nupic-source/nupic/engine/__init__.py", line 462, in executeCommand
    return self._region.executeCommand(args)
  File "/home/mmm/nupic/nupic-source/nupic/bindings/engine_internal.py", line 1295, in executeCommand
    return _engine_internal.Region_executeCommand(self, *args, **kwargs)
  File "/home/mmm/nupic/nupic-source/nupic/regions/PyRegion.py", line 313, in executeMethod
    return m(*args)
  File "/home/mmm/nupic/nupic-source/nupic/regions/ImageSensor.py", line 711, in loadMultipleImages
    self.explorer[2].update(numImages=len(self._imageList), sequenceCount=sequenceInfo[-1][0], frameCount=len(self._imageList))
IndexError: list index out of range

I suspect the problem is in the data I give it. I found this as official MNIST dataset is it what you originally used? It is in a binary format, not real images. Can you point me to the data you used?

@breznak It's the same dataset, but put in a subdirectory called mnist. We used an internal extraction script that creates a tree structure that looks like this:

|-- testing
|   |-- 0
|   |-- 1
|   |-- 2
|   |-- 3
|   |-- 4
|   |-- 5
|   |-- 6
|   |-- 7
|   |-- 8
|   `-- 9
`-- training
    |-- 0
    |-- 1
    |-- 2
    |-- 3
    |-- 4
    |-- 5
    |-- 6
    |-- 7
    |-- 8
    `-- 9

There are individual png files are labeled 000001.png etc.

@breznak Unfortunately I don't think I'll have too much time to help you debug this! It's not actively supported and I don't really recommend doing images with NuPIC today.

@subutai thanks! I just want to know if im starting off with correct data, before i jump into debugging.
I follow the structore ./mnist/{trainig,testing} but the data I downloaded is some binary.

-rw-r----- 1 mmm mmm 45M Jan  2 01:04 train-images-idx3-ubyte
-rw-r----- 1 mmm mmm 59K Jan  2 01:04 train-labels-idx1-ubyte

..will try to extract the real .png(s) from it.

@breznak I just uploaded the conversion scripts we used, along with a README. I haven't run that in a while though, so no idea if it still works!