我必须对在此仓库中发现的人工智能AlphaZero进行仿真:https://github.com/Zeta36/chess-alpha-zero 因此,首先,我尝试使用Google Colaboratory,但我不知道进行此模拟的正确方法(我只运行Untitled.ipynb),并且收到很多错误
ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'requirements.
这是一个明显的错误,因为Colab不知道谁是requirements.txt以及其他文件,但我不知道如何解决它。有什么想法吗?
所以,然后我以另一种方式尝试了: 1.我下载了项目 2.我按照readme.md上的说明运行了
pip install -r requirements.txt
在项目的根目录中,requirements.txt所在的位置。
我收到此错误:
Brunos-MBP-4:chess-alpha-zero-master Casella$ pip install -r requirements.txt
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting tensorflow-gpu (from -r requirements.txt (line 1))
Using cached https://files.pythonhosted.org/packages/d3/84/87cd052ffdb04c50985cdf23ac18fa6d479b916bc7048a05096eb2c522a0/tensorflow_gpu-1.1.0-cp27-cp27m-macosx_10_11_x86_64.whl
Collecting keras (from -r requirements.txt (line 2))
Using cached https://files.pythonhosted.org/packages/1b/18/2e1ef121e5560ac24c7ac9e363aa5fa7006c40563c989e7211aba95b793a/Keras-2.3.0-py2.py3-none-any.whl
Collecting profilehooks (from -r requirements.txt (line 3))
Using cached https://files.pythonhosted.org/packages/d4/ea/68e8f02b16e0a99b2238ff4e49f66c2aed134f6f6401ac2b04abea1e395d/profilehooks-1.11.0-py2.py3-none-any.whl
Requirement already satisfied: numpy in /usr/local/lib/python2.7/site-packages (from -r requirements.txt (line 4)) (1.16.5)
Collecting pyperclip (from -r requirements.txt (line 5))
Using cached https://files.pythonhosted.org/packages/2d/0f/4eda562dffd085945d57c2d9a5da745cfb5228c02bc90f2c74bbac746243/pyperclip-1.7.0.tar.gz
Collecting python-chess (from -r requirements.txt (line 6))
Using cached https://files.pythonhosted.org/packages/3d/ed/ae1dbb45de32df04c9b2cdfa1802bd7509978da1ad245b3180276f5937a6/python-chess-0.24.2.tar.gz
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python@2/bin/python2.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/pm/nj7yy3px76n6b62knyrn8r_40000gn/T/pip-install-zHPwd4/python-chess/setup.py'"'"'; __file__='"'"'/private/var/folders/pm/nj7yy3px76n6b62knyrn8r_40000gn/T/pip-install-zHPwd4/python-chess/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
cwd: /private/var/folders/pm/nj7yy3px76n6b62knyrn8r_40000gn/T/pip-install-zHPwd4/python-chess/
Complete output (9 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/pm/nj7yy3px76n6b62knyrn8r_40000gn/T/pip-install-zHPwd4/python-chess/setup.py", line 35, in <module>
""")
ImportError: You are installing python-chess on Python 2.
Python 2 support has been dropped. Consider upgrading to Python 3, or using
the 0.23.x branch, which will be maintained until the end of 2018.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
此错误,我认为是由于我在Mac上安装了python的两个版本,即2.7和3.7.4 无论如何,我继续运行readme.md的命令,然后运行它:
python src/chess_zero/run.py self
我收到了另一个错误:
Brunos-MBP-4:chess-alpha-zero-master Casella$ python src/chess_zero/run.py self
Traceback (most recent call last):
File "src/chess_zero/run.py", line 17, in <module>
mp.set_start_method('spawn')
AttributeError: 'module' object has no attribute 'set_start_method'
最后,我尝试使用修改第一个命令
pip3 install -r requirements.txt
我收到此错误
ERROR: Could not find a version that satisfies the requirement tensorflow-gpu (from -r requirements.txt (line 1)) (from versions: none)
ERROR: No matching distribution found for tensorflow-gpu (from -r requirements.txt (line 1))
有人可以帮助我吗?也欢迎有关如何在Colab上运行github项目的帮助。 预先谢谢你。