vicariousinc / science_rcn

Reference implementation of a two-level RCN model
https://www.vicarious.com/Common_Sense_Cortex_and_CAPTCHA.html
MIT License
663 stars 195 forks source link

Problem when using the code in win10 #7

Open XuhuiZhou opened 7 years ago

XuhuiZhou commented 7 years ago

Hi, I am really excited about your work. I am currently doing my own research. However, I am facing a problem now, when I run it on my windows10 device it show something like below s It seems to me that is not the problem of the system but the problem of the code itself. Hope you can give me a way to fix this and I will be really appreciated.

tbraga14 commented 7 years ago

Hi Edaward, are you still having issues with setup.py? I tested on Windows 7/10 and got it to work. The reasons you can't install might be:

Remove previous migw in your virtual environment with conda remove mingw. Try running conda install mingw libpython. You must have a working gcc/g++ dist in your PATH, like TDM-GCC (worked for me). Watch out to not mix gcc's in PATH.

Having different versions than specified in requirements.txt can throw any sorts of unrelated errors. Uninstall previously installed pkgs with e.g. conda remove decorator, then install only the exactly same versions from requirements.txt using e.g. conda install networkx==1.11 (one by one), except for rcn-ref==1.0.0 that is build as the setup progresses.

Use python setup.py install (don't bother with that bash Makefile in Windows or other ways of installing). This script was meant to work on the fly.

I installed in the default enviroment instead of virtualenv while it might work too.

If this is still not working and you really want this code to work, uninstall everything (MingW, Cygwin, Python2.7, Anaconda, also cleaning your system PATH from Cygwin and gcc stuff: believe me, it can be a real mess) and then start a clean install of Miniconda Python 2.7 following Daniel Renshaw's answer steps 1-5. Anaconda is bloated with packages you don't really need so install Miniconda instead.

To run python run.py, you must have data folder (with MNIST folder inside) in the same directory as run.py.

robertson-so commented 7 years ago

Like @tbraga14 said, it's only possible to compile dilation.cc on Windows if you use MinGW, using gcc/g++.

Technically speaking: The problem occurring here is the use of variable length arrays. While the dilation code is valid in C99 standard, Visual C++ for Python supports only C89 and won't accept this type of array declaration, leaving gcc/g++ as the only compiler option to use here.

More technical info: 6.19 Arrays of Variable Length

davidleon commented 6 years ago

take a look at https://www.github.com/davidleon/science_rcn it's windows visual c compatible. It runs on windows 10.