# MNIST error

**URL:** <https://discourse.numenta.org/t/mnist-error/4829>\
**Category:** NuPIC\
**Created:** [October 27, 2018, 2:50pm UTC](https://discourse.numenta.org/t/mnist-error/4829 "2018-10-27T14:50:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![JosefOndrej](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/josefondrej/32/3395_2.png) [@JosefOndrej](https://discourse.numenta.org/u/JosefOndrej)\
**Post date:** [October 27, 2018, 2:50pm UTC](https://discourse.numenta.org/t/mnist-error/4829/1 "2018-10-27T14:50:18Z")

</div>

Hi, I tried to run the mnist test file `htmresearch/projects/image_test/run_mnist_experiment.py` and I got the following error `RuntimeError: Matching Python module for ImageSensor not found.`. I tried to google it and found these two topics:

> <https://stackoverflow.com/questions/46641035/runtimeerror-matching-python-module-for-imagesensor-not-found>

> [@MNIST test problem](https://discourse.numenta.org/t/mnist-test-problem/1153):
>
> Hi, I am working now on image\_test at nupic.research/projects for MNIST classification. By running experiment: python [experiment.py](http://experiment.py) I have got the following error: ERR: Matching Python module for ImageSensor not found. [/home/binh/nupic/nupic.core/src/nupic/engine/RegionImplFactory.cpp line 431] Could you pls tell me, where can I import the module ImageSensor? Best thanks, Binh

I followed the instructions and tried to install nupic.vision (I am now able to `import nupic.vision` even `from nupic.vision.regions.ImageSensor import ImageSensor` works), but after running the mnist experiment again I get the same error. Could someone please give a step by step manual how could I get the experiment running from scratch? It looks like a cool project and it is really frustrating that it doesn’t work right out of the box.

---

<div class="post-metadata">

**Author:** ![MaxLee](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/maxlee/32/5546_2.png) [@MaxLee](https://discourse.numenta.org/u/MaxLee)\
**Post date:** [October 28, 2018, 8:49pm UTC](https://discourse.numenta.org/t/mnist-error/4829/2 "2018-10-28T20:49:47Z")

</div>

I see on that same thread, at the tail-end of it, this hint was given.

Try that. 🙂

> [@MNIST test problem](https://discourse.numenta.org/t/mnist-test-problem/1153/11):
>
> I just pulled the latest changes from nupic.vision. The only changes I needed to do was change “maxBoost” to “boostStrength” in run\_mnist\_experiment.py and remove line 166 sensor.setParameter("explorer",yaml.dump(["Flash"])) After that it runs for me with the head nupic code from yesterday.

---

<div class="post-metadata">

**Author:** ![JosefOndrej](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/josefondrej/32/3395_2.png) [@JosefOndrej](https://discourse.numenta.org/u/JosefOndrej)\
**Post date:** [October 29, 2018, 8:21am UTC](https://discourse.numenta.org/t/mnist-error/4829/3 "2018-10-29T08:21:22Z")

</div>

Thanks for the reply. I read that hint, the problem is that it is quite old and in the [latest version](https://github.com/numenta/htmresearch/blob/master/projects/image_test/run_mnist_experiment.py) of the file there is no parameter `maxBoost` and the line 166 looks different. I tried to search for the line and found two lines that probably do the same, I removed them but it did not help.

---

<div class="post-metadata">

**Author:** ![fcred](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/fcred/32/433_2.png) [@fcred](https://discourse.numenta.org/u/fcred)\
**Post date:** [October 29, 2018, 12:06pm UTC](https://discourse.numenta.org/t/mnist-error/4829/4 "2018-10-29T12:06:02Z")

</div>

The tip version of nupic.vision already incorporates all the needed changes and should run with no changes. I just tried it.  
Perhaps your Python path does not include `nupic.vision/src`.

---

<div class="post-metadata">

**Author:** ![JosefOndrej](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/josefondrej/32/3395_2.png) [@JosefOndrej](https://discourse.numenta.org/u/JosefOndrej)\
**Post date:** [November 9, 2018, 9:06pm UTC](https://discourse.numenta.org/t/mnist-error/4829/5 "2018-11-09T21:06:09Z")

</div>

Can I ask what is the exact configuration you are running the experiment in? I have `nupic.vision/src` in my python path and I am still getting the same error.

---

<div class="post-metadata">

**Author:** ![fcred](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/fcred/32/433_2.png) [@fcred](https://discourse.numenta.org/u/fcred)\
**Post date:** [November 9, 2018, 11:44pm UTC](https://discourse.numenta.org/t/mnist-error/4829/6 "2018-11-09T23:44:58Z")

</div>

I am running Anaconda Python 2.7 on Mojave on a Mac.

This is my command line:  
`~/Development/nupic.vision/src#python nupic/vision/mnist/run_mnist_experiment.py --data-dir ./nupic/vision/mnist/data`

Note that I am running this from the `nupic.vision/src` folder. Hence I even do not have to set the python path to here for this to work.

---

<div class="post-metadata">

**Author:** ![JosefOndrej](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/josefondrej/32/3395_2.png) [@JosefOndrej](https://discourse.numenta.org/u/JosefOndrej)\
**Post date:** [November 10, 2018, 10:36am UTC](https://discourse.numenta.org/t/mnist-error/4829/7 "2018-11-10T10:36:14Z")

</div>

Thank you! I finally got it working. The problem was that I tried to run the [experiment](https://github.com/numenta/htmresearch/blob/master/projects/image_test/run_mnist_experiment.py) in `htmresearch` repository and not [the one](https://github.com/numenta/nupic.vision/blob/master/src/nupic/vision/mnist/run_mnist_experiment.py) in `nupic.vision`.
