numenta / nupic-legacy

Numenta Platform for Intelligent Computing is an implementation of Hierarchical Temporal Memory (HTM), a theory of intelligence based strictly on the neuroscience of the neocortex.
http://numenta.org/
GNU Affero General Public License v3.0
6.33k stars 1.56k forks source link

CLAClassifier bugreport #2688

Open codedhard opened 8 years ago

codedhard commented 8 years ago

https://github.com/numenta/nupic/blob/master/examples/network/hierarchy_network_demo.py#L225

'implementation': 'py'

Error:

Writing output to: hierarchy-demo-output.csv
Traceback (most recent call last):
  File "hierarchy_network_demo.py", line 372, in <module>
    runDemo()
  File "hierarchy_network_demo.py", line 366, in runDemo
    runNetwork(network, numRecords, writer)
  File "hierarchy_network_demo.py", line 306, in runNetwork
    network.run(1)
  File "/usr/local/lib/python2.7/dist-packages/nupic-0.3.6.dev0-py2.7.egg/nupic/engine/__init__.py", line 666, in run
    engine.Network.run(self, n)
  File "/usr/local/lib/python2.7/dist-packages/nupic.bindings-0.2.2-py2.7-linux-x86_64.egg/nupic/bindings/engine_internal.py", line 1146, in run
    return _engine_internal.Network_run(self, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/nupic-0.3.6.dev0-py2.7.egg/nupic/regions/CLAClassifierRegion.py", line 289, in compute
    categories = [category for category in inputs["categoryIn"]
KeyError: 'categoryIn'
rhyolight commented 8 years ago

@codedhard So when you change back to 'implementation': 'cpp' it works fine?

Why do you want to use the python implementation (just curious)?

codedhard commented 8 years ago

@rhyolight No does not work with 'implementation': 'cpp' the result is "Killed" and nothing more.

Just for debugging purpose because the other implementation was not giving any "errors" other then "Killed".

rhyolight commented 8 years ago

@codedhard Can you provide more info about the problem when using cpp?

Thanks.

rcrowder commented 8 years ago

This is a nupic.core issue somewhere within the engine region interface. Same occurs with py and cpp CLA Classifier factory output. Without recreating a C++ version of the hierarchy_network_demo it's tricky to work out in PyCharm what happens in the Core. The simplest way to recreate can be;

Spin up a new Ubuntu 14.02 (LTS) VM. It comes with Python 2.7.6 and GCC 4.8.x

Add Python dependencies

Pip not installed.. following installs 1.5.4

pip install numpy fails (no Python.h) needs;

Install bindings and nupic (sudo added to get around permissions)

victaie commented 8 years ago

I got the exactly same issue when using SDRCategoryEncoder :( BTW, I'm using docker version nupic

rhyolight commented 8 years ago

FYI @ywcui1990 Please read above.