Sudden inability to run python files in docker containers

Running docker containers with latest numenta/nupic image and suddenly having trouble running examples I have previously run just fine. Similar error messages as follows:

/usr/local/src/nupic/examples/opf/clients/hotgym/simple# python
/usr/include/c++/4.8/debug/vector:346:error: attempt to subscript container
with out-of-bounds index 29, but container only holds 29 elements.

Objects involved in the operation:
sequence “this” @ 0x0x370def0 {
type = NSt7__debug6vectorIN5nupic10algorithms6Cells49InSynapseESaIS4_EEE;


/usr/local/src/nupic/examples/network# python
spatial pooler region inputs: [‘sequenceIdIn’, ‘resetIn’, ‘topDownIn’, ‘bottomUpIn’]
spatial pooler region outputs: [‘topDownOut’, ‘spatialTopDownOut’, ‘temporalTopDownOut’, ‘bottomUpOut’, ‘anomalyScore’]
spatial pooler columns: 2048

temporal memory region inputs: [‘sequenceIdIn’, ‘resetIn’, ‘bottomUpIn’]
temporal memory region outputs: [‘lrnActiveStateT’, ‘activeCells’, ‘bottomUpOut’, ‘topDownOut’, ‘predictedActiveCells’, ‘anomalyScore’]
temporal memory columns: 2048

Writing output to network-demo-anomaly-output.csv
/usr/include/c++/4.8/debug/vector:346:error: attempt to subscript container
with out-of-bounds index 30, but container only holds 30 elements.

Objects involved in the operation:
sequence “this” @ 0x0x1dd44e0 {
type = NSt7__debug6vectorIN5nupic10algorithms6Cells49InSynapseESaIS4_EEE;

Any clues? Is it possible to pull an old NuPIC image, such as 0.5.3, from which I know I can run the example python files and modify for my own experiments?

1 Like

I should add that on the network example the csv file IS written, but aborts ~30 lines in.

cc @rhyolight @subutai @mrcslws

It looks like you’re running the Debug (error-checking) build of nupic.bindings (nupic.core). What is the exact source of the container and nupic.bindings build? Please provide the URL.

You should not be hitting this error in a release build.

We’re aware of out-of-bounds index accesses at the moment that look similar to the one you have reported. See

Would you mind reviewing and either adding your information to it or opening a new issue in nupic.core with the relevant details?

Many thanks!


1 Like

Ideally, in our CI system, we should be running tests in debug mode as well as release mode. If this bug is actually being encountered while running HotGym in debug mode, there may be lingering important bugs that are caught by debug mode but not currently addressed.

1 Like

Thank you for the quick response. I will continue to research and will add to the issue you linked.

Fyi…I am running the following:

OSX 10.9.5
Docker 1.11.1

I do the following:

docker pull numenta/nupic
docker run -i -t numenta/nupic /bin/bash
cd $NUPIC/examples/network

I did this simple operation all summer without issue. I want to understand the script well enough to import other encoders, specify different outputs, etc.

Since any container spun up is using the latest NuPIC image, this should take care of the build issues you mention, no?

I found the explanation for why you were able to run fine all summer, and then !! was merged in September, and it changes Dockerfile to build Debug (error-checking) build of nupic.bindings. The Debug build compiles-in various error-checking code, including that of the C++ STL, which is what catches the nupic.core/nupic.bindings bug in this case.

I think it’s catching a real bug in nupic.core.

For now, you can suppress the reporting of this bug by changing the nupic.core CMAKE_BUILD_TYPE to Release in

CC @scott @rhyolight @Austin_Marshall


I added a note and a link to this topic in


Too late at night for me to digest, but in I changed "maxSynapsesPerSegment" (TPRegion) from 32 to 332, and it works (i.e. script does not abort/ all 2000 lines of network-demo-anomaly-output.csv are written). I am presumably still running in Debug mode.

I throw this out as a fact only–I don’t know the effect on the anomalyScore or anomalyLikelihood by increasing the maximum synapses as described above.