I am newbie, help me run code

hi everyone, can you help me.
i download code from https://github.com/carver/pyHTM
but i dont know how to run it, i use python ver 2.7 on windows
i am newbie in python and HTM

1 Like

You should start by reading the NuPIC Wiki. Don’t use this codebase. It is old, looks unsupported. See here for a list of popular HTM implementations.

thank you. i am learnning about HTM for recognization digits handwritten. but i dont know any code talk about this. can you help me?

This might help you out.

@tikky there is this code provided: https://github.com/numenta/nupic.vision/tree/master/src/nupic/vision/mnist

I’m not sure if it still works. Also, according to this site: https://rodrigob.github.io/are_we_there_yet/build/classification_datasets_results.html#4d4e495354

The best error rates are below 0.5%, much better than the reported ~5% error rate for HTM.

thank you so much.
but when i run code. i get error ImportError: No module named numpy. can you help me fix this error

Have you installed NuPIC? If so, how did you do it?

sorry, i dont understand. i download code, then i run, and i get that error. so how can i install Nupic

1 Like

For any new piece of code you want to try and run, the first thing to do is read the README file. The NuPIC README is here and in the root directory of the code you downloaded.

The README tells you two ways you can install. If you only want to use NuPIC, you don’t even need the source code. You can try installing with pip install nupic. This works on most modern computer environments (macOS, Windows, Linux), but sometimes dependencies need to be installed.

The other way to install is to compile the code yourself (including the C++ in nupic.core). If you don’t care about how NuPIC works, you don’t want to do this.

thank you so much. i will install it. i use windows.

1 Like

when i run setup.py numpy 1.11.2 . i get error
================= RESTART: C:\Python27\numpy-1.11.2\setup.py =================
Running from numpy source directory.
can you help me? thank you

You should not need to install numpy from source code. When you run pip install nupic, numpy should get installed from binary on your system. What is the console output when you run pip install nupic?

sorry. i dont understand you mean. i use python 2.7.1 on windows. my work screen is Python 2.7.13 Shell. how can i run pip install nupic.

You must get to a command prompt. I’m not familiar with your environment, I’m sorry I can’t help much here.

If you can take a screenshot of your screen and post here, it might help. You can upload images by dragging them into the comment box.

thank you. this is my images

today, i install utunbu, i still cant install PIL and pip
can you help me? thank you

i amnot sure, but maybe i intall numpic.
but when i run code i get error
tien@ubuntu:~/Desktop/nupic.vision-master$ python demo.py
Traceback (most recent call last):
File “demo.py”, line 37, in
from nupic.research.spatial_pooler import SpatialPooler
ImportError: No module named nupic.research.spatial_pooler

and this is first codes of demo.py

import dataset_readers as data
import image_encoders as encoder
from nupic.research.spatial_pooler import SpatialPooler
from vision_testbench import VisionTestBench
from classifiers import exactMatch

can you help me fix error? thank you

I still don’t think you have nupic installed correctly.

In Ubuntu, run pip install nupic and paste the console output to see what went wrong.

i just run your command
i get

Installing collected packages: py, pytest, coverage, cov-core, pytest-cov, apipkg, execnet, pytest-xdist, numpy, nupic.bindings, DBUtils, pycapnp, mock, asteval, validictory, pyproj, prettytable, psutil, unittest2, six, python-dateutil, ordereddict, PyMySQL, PyYAML, nupic

Traceback (most recent call last):
  File "/home/tien/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/home/tien/.local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
  File "/home/tien/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
  File "/home/tien/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/home/tien/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
  File "/home/tien/.local/lib/python2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/home/tien/.local/lib/python2.7/site-packages/pip/wheel.py", line 316, in clobber
  File "/home/tien/.local/lib/python2.7/site-packages/pip/utils/__init__.py", line 83, in ensure_dir
  File "/usr/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/py-1.4.33.dist-info'

how can i fix it