Blog post is here
If you want an intro to neural nets and the "long version" of what this is and what it does, read my blog post.
Data can be downloaded here. Many thanks to ThinkNook for putting such a great resource out there.
You need Python 2 to run this project; I also recommend Virtualenv and iPython.
Run pip install
to install everything listed in requirements.txt
.
You need to train your net once, and then you can load those settings and use it whenever you want without having to retrain it.
Change line 10 of makeModel.py
to point to wherever you downloaded your data as a CSV.
Then run Python makeModel.py
(or, if you're in iPython, run makeModel.py
). Then go do something else for the 40-60 minutes that it takes to train your neural net.
When creating the net finishes, three new files should have been created: dictionary.json
, model.json
, and model.h5
. You will need these to use the net.
To use the net to classify data, run loadModel.py
and type into the console when prompted. Hitting Enter without typing anything will quit the program.
@malgamves,
I was seeing the same error on my Ubuntu machine, however it works perfectly on my iMac. Both with 8GB RAM.
It turns out this example uses a whole load of RAM. If you're on Mac it should be ok due to the way MacOS dynamically allocates virtual memory from your disk when you run out of physical RAM. However, it would also fail on a Mac if you're low on disk space or have the virtual memory disabled.
On my Ubuntu it was failing due to the swapfile (Ubuntu's virtual memory) being only 2GB. I had to increase it all the way to 16GB before this finally worked. On other Linux flavours you'd have to increase the size of your swap partition, which is a lot more work.
Haven't tried it on Windows, but afaik you would need to increase the size of your pagefile in the Advanced section of your System Settings.