Comments (3)
能否贴上详细的报错信息(包括栈信息),以及python的版本。
推测是因为python版本的问题,如果不是3.6的python建议先安装一个3.6的python试试。
from gomoku-zero.
我按照您的建议安装了python3.6,仍然报错,运行playwithme.py这个文件可以玩,但在chrome浏览器上会报错500,在后端报错是这样的:
[2019-06-02 13:24:27,593] ERROR in app: Exception on /aiplay [GET]
Traceback (most recent call last):
File "C:\Python36\lib\site-packages\flask\app.py", line 2311, in wsgi_app
response = self.full_dispatch_request()
File "C:\Python36\lib\site-packages\flask\app.py", line 1834, in full_dispatch_request
rv = self.handle_user_exception(e)
File "C:\Python36\lib\site-packages\flask_cors\extension.py", line 161, in wrapped_function
return cors_after_request(app.make_response(f(*args, **kwargs)))
File "C:\Python36\lib\site-packages\flask\app.py", line 1737, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "C:\Python36\lib\site-packages\flask_compat.py", line 36, in reraise
raise value
File "C:\Python36\lib\site-packages\flask\app.py", line 1832, in full_dispatch_request
rv = self.dispatch_request()
File "C:\Python36\lib\site-packages\flask\app.py", line 1818, in dispatch_request
return self.view_functionsrule.endpoint
File "app.py", line 39, in aiplay
status, move = aiRunner.aiplay()
File "D:\python学习\Finalwuziqi\Finalwuziqi\aiclass.py", line 44, in aiplay
move,policy_ = self.mcts.search_move(autoMoveIntoChild = False)
File "D:\python学习\Finalwuziqi\Finalwuziqi\mcts.py", line 66, in search_move
self.loop.run_until_complete(asyncio.gather(*coroutineList))
File "C:\Python36\lib\asyncio\tasks.py", line 596, in gather
fut = ensure_future(arg, loop=loop)
File "C:\Python36\lib\asyncio\tasks.py", line 518, in ensure_future
loop = events.get_event_loop()
File "C:\Python36\lib\asyncio\events.py", line 694, in get_event_loop
return get_event_loop_policy().get_event_loop()
File "C:\Python36\lib\asyncio\events.py", line 602, in get_event_loop
% threading.current_thread().name)
RuntimeError: There is no current event loop in thread 'Thread-8'.
感谢您的任何建议
from gomoku-zero.
抱歉,这个repo的部分代码并不是我写的,我个人对python的熟悉程度不高,可能无法解决你的问题。
根据:https://stackoverflow.com/questions/46727787/runtimeerror-there-is-no-current-event-loop-in-thread-in-async-apscheduler,
试试把mcts.py的__init__函数里的
self.loop = asyncio.get_event_loop()
修改为
self.loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
from gomoku-zero.
Related Issues (2)
- 请教一下无法运行的问题。。 HOT 24
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gomoku-zero.