weixin_39932181
weixin_39932181
2020-12-30 03:33

brian2 installing and running appear some error

Error encountered with object named "statemonitor". Object was created here (most recent call only, full details in debug log): File "example4.py", line 27, in statemon = StateMonitor(group, 'v', record=True) An error occurred when preparing an object. ValueError: Unknown code generation target: numpy , should be one of ['auto', 'cython', 'numpy', 'weave']

该提问来源于开源项目:brian-team/brian2

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

12条回答

  • GRASE0427 GRASE0427 1月前

    ValueError: Unknown code generation target:  numpy , should be  one of ['auto', 'numpy', 'cython']

    and my version of brian2 is 2.4.2, When I run the 'More complex connectivity' in 'Introduction to Brian part 2: Synapses', the problem occur. i didn 't know why? Can you help me?   Should I change my version of brian2 to 2.2.1?

    点赞 评论 复制链接分享
  • weixin_39843151 weixin_39843151 3月前

    ValueError: Unknown code generation target: weave, should be one of ['auto', 'cython', 'numpy'] I also have this problem , and my version of brian2. is 2.2.1.1.
    When I run the Example: float_32_64_benchmark.py, the problem occur , and i didn 't know why?

    点赞 评论 复制链接分享
  • weixin_39726044 weixin_39726044 3月前

    ValueError: Unknown code generation target: weave, should be one of ['auto', 'cython', 'numpy'] I also have this problem , and my version of brian2. is 2.2.1.1. When I run the Example: float_32_64_benchmark.py, the problem occur , and i didn 't know why?

    -wang Your problem is unrelated to the OP's problem. You are running an example that runs benchmark for all code generation targets that Brian supports, but this includes the weave target which is only supported under Python 2.x. If you want to run this example under Python 3.x, you can exclude the weave target by removing it from the targets = [...] list defined in line 127. But note that this example was really only used for internal benchmarking, it is not a relevant example for neural modelilng.

    点赞 评论 复制链接分享
  • weixin_39932181 weixin_39932181 3月前

    ,thanks. I have updated the Brian2 using "conda update -c conda-forge brian2". Below is my result of brian2.test(), that is false. Actually my previous test result is also false,but my procedure can be still run except the error of running "brian2.plot(rate_monitors[name].t/b2.second, rate_monitors[name].rate, '.')". Why does brian2.test() always occur the error ? lookinig forword to your solution. image

    点赞 评论 复制链接分享
  • weixin_39726044 weixin_39726044 3月前

    The warning problem should be something that has been fixed with the latest release, can you verify that you indeed have the latest version? I.e.:

    python
    import brian2
    print(brian2.__version__)
    

    should print 2.2.1.

    Either way, if all your test failures are about problems with warnings, then you can safely ignore them, everything will work fine.

    Actually my previous test result is also false,but my procedure can be still run except the error of running "brian2.plot(rate_monitors[name].t/b2.second, rate_monitors[name].rate, '.')".

    I don't quite understand, what code is producing what error?

    点赞 评论 复制链接分享
  • weixin_39932181 weixin_39932181 3月前

    ,my version of brian2 is 2.2 rather than 2.2.1 after update brain2 using"conda update -c conda-forge brian2", what's the matter between them. you means, though the result of brian2.test() is False , does it not matter if all your test failures are about problems with warnings but no error ? image

    点赞 评论 复制链接分享
  • weixin_39726044 weixin_39726044 3月前

    ,my version of brian2 is 2.2 rather than 2.2.1 after update brain2 using"conda update -c conda-forge brian2", what's the matter between them.

    I think that means that some other package is holding back brian2 from being installed. I guess you get an error if you try to do conda install -c conda-forge brian2=2.2.1? The error message should give you an idea of what the problem is.

    you means, though the result of brian2.test() is False , does it not matter if all your test failures are about problems with warnings but no error ?

    Our test suite checks in a couple of places that warnings are raised (or not), as expected. When you combine Brian 2 < 2.2.1 with recent versions of Cython, you get a number of additional warnings which make these tests fail. These warnings are annoying but not a problem. Ideally you want of course to update Brian2, but alternatively downgrading Cython should also get rid of the warnings.

    点赞 评论 复制链接分享
  • weixin_39726044 weixin_39726044 3月前

    I'm going to close this issue for now, feel free to re-open it if you still have the problem.

    点赞 评论 复制链接分享
  • weixin_39726044 weixin_39726044 3月前

    Hi, sorry for the late reply... Do you still have this problem? If yes, can you update to the latest Brian version (2.2) and check again? The error message is quite odd and I haven't seen this problem before. Can you provide a minimal example that reproduces it for you?

    点赞 评论 复制链接分享
  • weixin_39726044 weixin_39726044 3月前

    ping (see my previous comment)

    点赞 评论 复制链接分享
  • weixin_39932181 weixin_39932181 3月前

    thank you. what's the difference of installing between Brian2 version (2.2)and other version ? I find the commands of their installing same from https://brian2.readthedocs.io/en/2.2/introduction/install.html

    点赞 评论 复制链接分享
  • weixin_39726044 weixin_39726044 3月前

    There's no difference in installing, but if you installed Brian 2 before the release of Brian 2 you need to update it. If you installed with conda, use conda update -c conda-forge brian2, for pip use pip install brian2 --upgrade (or pip install brian2 --upgrade --no-deps to avoid also updating all dependencies).

    点赞 评论 复制链接分享