-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Only a single run statement is supported for the genn device. #102
Comments
That is very strange, the same example runs just fine on my install/setup. Can you post the log file? |
Are you maybe running more than one simulation in the same process (ipython session, jupyter notebook, ...)? If that's the case, you'll have to use device.reinit()
device.activate() during the runs (see the Brian2 documentation). |
runfile('//file/Usersc$/cji39/Home/Downloads/brian2genn-1.3.1/examples/simple_example.py', wdir='//file/Usersc$/cji39/Home/Downloads/brian2genn-1.3.1/examples') File "\file\Usersc$\cji39\Home\Downloads\brian2genn-1.3.1\examples\simple_example.py", line 14, in File "D:\Anaconda\lib\site-packages\brian2\units\fundamentalunits.py", line 2392, in new_f File "D:\Anaconda\lib\site-packages\brian2\core\magic.py", line 374, in run File "D:\Anaconda\lib\site-packages\brian2\core\magic.py", line 232, in run File "D:\Anaconda\lib\site-packages\brian2\core\base.py", line 278, in device_override_decorated_function File "D:\Anaconda\lib\site-packages\brian2genn\device.py", line 1608, in network_run NotImplementedError: Only a single run statement is supported for the genn device. |
When I used these two, it showed another problem like below: runfile('//file/Usersc$/cji39/Home/Downloads/brian2genn-1.3.1/examples/simple_example.py', wdir='//file/Usersc$/cji39/Home/Downloads/brian2genn-1.3.1/examples') File "D:\Anaconda\lib\site-packages\brian2genn\device.py", line 782, in build File "D:\Anaconda\lib\site-packages\brian2genn\device.py", line 994, in compile_source File "D:\Anaconda\lib\subprocess.py", line 363, in check_call CalledProcessError: Command '"C:\Users\cji39\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat" x86_amd64 && D:\genn\lib\bin\genn-buildmodel.bat magicnetwork_model.cpp && nmake /f WINmakefile clean && nmake /f WINmakefile' returned non-zero exit status 1. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "\file\Usersc$\cji39\Home\Downloads\brian2genn-1.3.1\examples\simple_example.py", line 15, in File "D:\Anaconda\lib\site-packages\brian2\units\fundamentalunits.py", line 2392, in new_f File "D:\Anaconda\lib\site-packages\brian2\core\magic.py", line 374, in run File "D:\Anaconda\lib\site-packages\brian2\core\magic.py", line 232, in run File "D:\Anaconda\lib\site-packages\brian2\core\base.py", line 278, in device_override_decorated_function File "D:\Anaconda\lib\site-packages\brian2genn\device.py", line 1634, in network_run File "D:\Anaconda\lib\site-packages\brian2\devices\cpp_standalone\device.py", line 1514, in network_run File "D:\Anaconda\lib\site-packages\brian2genn\device.py", line 788, in build RuntimeError: Project compilation failed (Command "C:\Users\cji39\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat" x86_amd64 && D:\genn\lib\bin\genn-buildmodel.bat magicnetwork_model.cpp && nmake /f WINmakefile clean && nmake /f WINmakefile failed with error code 1). |
This is getting confusing. How are you running things? The easiest way to run things correctly is to make sure that you run each script in its own process. If you are running your script from an IDE like PyCharm or Spyder make sure to not select "Run with Python console" (PyCharm), or select "Run in a dedicated console" (Spyder). The two lines I posted work as well, you might have put them in the wrong place (indicated by a message about Cython compilation which should not be happening). |
I ran it in Spyder and did not select those items you mentioned. I add these two lines like below: from brian2 import * set_device('genn') run(10*ms) I got the error: RuntimeError: Project compilation failed (Command "C:\Users\cji39\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\vcvarsall.bat" x86_amd64 && D:\genn\lib\bin\genn-buildmodel.bat magicnetwork_model.cpp && nmake /f WINmakefile clean && nmake /f WINmakefile failed with error code 1). |
To follow my advice, you should select "run in a dedicated console" in Spyder. Sorry, if that wasn't clear. If you are still getting a compilation error, then this is something unrelated to your initial issue. In that case we'd need the full output and/or the log files. |
Hi,
I just ran the example code like below:
The error is: Only a single run statement is supported for the genn device.
So what is the problem? Thanks.
The text was updated successfully, but these errors were encountered: