Build network example

I want to build example:

And I got the next errors:
File “hierarchy_network_demo.py”, line 366, in
runDemo()
File “hierarchy_network_demo.py”, line 360, in runDemo
runNetwork(network, numRecords, writer)
File “hierarchy_network_demo.py”, line 303, in runNetwork
network.run(1)
File “/usr/local/lib/python2.7/dist-packages/nupic/engine/init.py”, line 673, in run
engine_internal.Network.run(self, n)
File “/home/sergey/.local/lib/python2.7/site-packages/nupic/bindings/engine_internal.py”, line 1244, in run
return _engine_internal.Network_run(self, *args, **kwargs)
File “/home/sergey/.local/lib/python2.7/site-packages/nupic/bindings/regions/PyRegion.py”, line 174, in guardedCompute
return self.compute(inputs, DictReadOnlyWrapper(outputs))
File “/usr/local/lib/python2.7/dist-packages/nupic/regions/SDRClassifierRegion.py”, line 349, in compute
categories = [category for category in inputs[“categoryIn”]
KeyError: ‘categoryIn’

Maybe I don’t have some libraries ?

@Sergey I’m getting the same error. I have not run this example in awhile. Can you try the new Network Quick Start Guide?

@rhyolight I’m trying to use Network Quick Start Guide, but get the next errors:

/usr/bin/python2.7 /var/www/htm/tests/network3.py
ERR:  Matching Python module for TMRegion not found. [/root/bamboo-agent-home/xml-data/build-dir/NUP-CORE-NCRM/src/nupic/engine/RegionImplFactory.cpp line 444]
Traceback (most recent call last):
  File "/var/www/htm/tests/network3.py", line 154, in <module>
    runHotgym(_NUM_RECORDS)
  File "/var/www/htm/tests/network3.py", line 119, in runHotgym
    network = createNetwork(dataSource)
  File "/var/www/htm/tests/network3.py", line 73, in createNetwork
    network.addRegion("TM", "py.TMRegion", json.dumps(modelParams["tmParams"]))
  File "/usr/local/lib/python2.7/dist-packages/nupic/engine/__init__.py", line 645, in addRegion
    engine_internal.Network.addRegion(self, name, nodeType, nodeParams)
  File "/home/sergey/.local/lib/python2.7/site-packages/nupic/bindings/engine_internal.py", line 1180, in addRegion
    return _engine_internal.Network_addRegion(self, *args, **kwargs)
RuntimeError: Matching Python module for TMRegion not found.

Can you help me? Maybe I don’t have some modules?

Right… see:

As soon as we release 0.7.0 (not sure when yet), this problem should go away. In the meantime to run the example code you’ll need to either adjust your local codebase with the changed mentioned in that thread, or build from source code by running

python setup.py install --user

From the nupic checkout.

@rhyolight I wrote:
sergey@sergey /var/www/nupic $ git checkout tags/0.6.0
M tests/unit/nupic/algorithms/sdr_classifier_test.py
HEAD is now at 9812ff0… Merge pull request #3502 from rhyolight/0.6.0-prerelease

Then I run example Network Quick Start Guide
And I got same errors:
ERR: Matching Python module for TMRegion not found. [/root/bamboo-agent-home/xml-data/build-dir/NUP-CORE-NCRM/src/nupic/engine/RegionImplFactory.cpp line 444]
Traceback (most recent call last):
File “network3.py”, line 154, in
runHotgym(_NUM_RECORDS)
File “network3.py”, line 119, in runHotgym
network = createNetwork(dataSource)
File “network3.py”, line 73, in createNetwork
network.addRegion(“TM”, “py.TMRegion”, json.dumps(modelParams[“tmParams”]))
File “/usr/local/lib/python2.7/dist-packages/nupic/engine/init.py”, line 645, in addRegion
engine_internal.Network.addRegion(self, name, nodeType, nodeParams)
File “/home/sergey/.local/lib/python2.7/site-packages/nupic/bindings/engine_internal.py”, line 1180, in addRegion
return _engine_internal.Network_addRegion(self, *args, **kwargs)
RuntimeError: Matching Python module for TMRegion not found.

I think you’re going to need to build from source to run the new network example in the quick start. That guide is not attached to a stable release yet.

In the meantime, I’ll try to figure out why the previous example is failing for both of us.

@Sergey I found the original bug report on this broken example:

I was able to get the example working by switching the params spatialImp & temporalImp to py instead of cpp.

EDIT: Actually, it did not work. I will follow up on the issue above.

@rhyolight the same errors. Can you figure out about failling in hierarchy_network_demo.py or your Network Quick Start Guide?

Thanx a lot for your support!

1 Like