starry-sky6688/MARL-Algorithms

Quick Start 会报错,请问是什么问题。

Closed this issue · 2 comments

我已经安装好相关依赖,如下所示。

(pytorch) yzh@yzh:~/MARL-Algorithms$ pip install -r requirements.txt
Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting SMAC@ git+https://github.com/oxwhirl/smac.git
  Cloning https://github.com/oxwhirl/smac.git to /tmp/pip-install-ujf9q8zb/smac_9f8198e2a1ff4a8c85ab124590bc3d01
  Running command git clone --filter=blob:none --quiet https://github.com/oxwhirl/smac.git /tmp/pip-install-ujf9q8zb/smac_9f8198e2a1ff4a8c85ab124590bc3d01
  Resolved https://github.com/oxwhirl/smac.git to commit d6aab33f76abc3849c50463a8592a84f59a5ef84
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: matplotlib==3.5.3 in /home/yzh/anaconda3/envs/pytorch/lib/python3.7/site-packages (from -r requirements.txt (line 1)) (3.5.3)
Collecting PySC2==4.0.0
  Downloading http://mirrors.aliyun.com/pypi/packages/f1/8c/60c61ff677e7e3b854f9d1fc1432200c2a34ccb0324d9210cadf4766c688/PySC2-4.0.0-py3-none-manylinux2010_x86_64.whl (4.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.0/4.0 MB 3.0 MB/s eta 0:00:00
Collecting protobuf==3.19.0
  Downloading http://mirrors.aliyun.com/pypi/packages/0a/df/9515bb753aa8583cf195ba8fd25bb166b51b18044bc45634ec9e5fc22199/protobuf-3.19.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 2.9 MB/s eta 0:00:00
Collecting torch==1.12.1
  Downloading http://mirrors.aliyun.com/pypi/packages/b9/af/23c13cd340cd333f42de225ba3da3b64e1a70425546d1a59bfa42d465a5d/torch-1.12.1-cp37-cp37m-manylinux1_x86_64.whl (776.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 776.3/776.3 MB 1.1 MB/s eta 0:00:00
Requirement already satisfied: pyparsing>=2.2.1 in /home/yzh/anaconda3/envs/pytorch/lib/python3.7/site-packages (from matplotlib==3.5.3->-r requirements.txt (line 1)) (3.1.2)
Requirement already satisfied: kiwisolver>=1.0.1 in /home/yzh/anaconda3/envs/pytorch/lib/python3.7/site-packages (from matplotlib==3.5.3->-r requirements.txt (line 1)) (1.4.5)
Requirement already satisfied: fonttools>=4.22.0 in /home/yzh/anaconda3/envs/pytorch/lib/python3.7/site-packages (from matplotlib==3.5.3->-r requirements.txt (line 1)) (4.38.0)
Requirement already satisfied: pillow>=6.2.0 in /home/yzh/anaconda3/envs/pytorch/lib/python3.7/site-packages (from matplotlib==3.5.3->-r requirements.txt (line 1)) (9.5.0)
Requirement already satisfied: cycler>=0.10 in /home/yzh/anaconda3/envs/pytorch/lib/python3.7/site-packages (from matplotlib==3.5.3->-r requirements.txt (line 1)) (0.11.0)
Requirement already satisfied: numpy>=1.17 in /home/yzh/anaconda3/envs/pytorch/lib/python3.7/site-packages (from matplotlib==3.5.3->-r requirements.txt (line 1)) (1.21.6)
Requirement already satisfied: packaging>=20.0 in /home/yzh/anaconda3/envs/pytorch/lib/python3.7/site-packages (from matplotlib==3.5.3->-r requirements.txt (line 1)) (24.0)
Requirement already satisfied: python-dateutil>=2.7 in /home/yzh/anaconda3/envs/pytorch/lib/python3.7/site-packages (from matplotlib==3.5.3->-r requirements.txt (line 1)) (2.9.0.post0)
Collecting s2clientprotocol>=4.10.1.75800.0
  Downloading http://mirrors.aliyun.com/pypi/packages/10/77/24b3dad18e7ae83d7ab914ae05076ba307968e420b190a497b99ec5f15d4/s2clientprotocol-5.0.12.91115.0-py2.py3-none-any.whl (55 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 55.6/55.6 kB 379.9 kB/s eta 0:00:00
Collecting dm-env-rpc
  Downloading http://mirrors.aliyun.com/pypi/packages/7f/f6/fe7402cf871ba34007eeebadad5f46ce2fc2c641bfb3c52aa2094d7d6494/dm_env_rpc-1.1.6-py3-none-any.whl (76 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 76.5/76.5 kB 919.3 kB/s eta 0:00:00
Collecting sk-video
  Downloading http://mirrors.aliyun.com/pypi/packages/dd/3f/ce848b8b2062ad1ccf1449094a740c775f6c761339f411e44f1e090f23a7/sk_video-1.1.10-py2.py3-none-any.whl (2.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.3/2.3 MB 2.7 MB/s eta 0:00:00
Collecting absl-py>=0.1.0
  Downloading http://mirrors.aliyun.com/pypi/packages/a2/ad/e0d3c824784ff121c03cc031f944bc7e139a8f1870ffd2845cc2dd76f6c4/absl_py-2.1.0-py3-none-any.whl (133 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.7/133.7 kB 3.0 MB/s eta 0:00:00
Collecting deepdiff
  Downloading http://mirrors.aliyun.com/pypi/packages/5a/8f/a9d39ec15f40e8169cb134317824ee4618b864b2e4b91a9b310d3ef94729/deepdiff-6.7.1-py3-none-any.whl (76 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 76.6/76.6 kB 1.4 MB/s eta 0:00:00
Collecting s2protocol
  Downloading http://mirrors.aliyun.com/pypi/packages/53/32/d6bd2b0b231a4eac60fec1bcdc4dfcfa4d67c55e64916ae6b8d40aaf3175/s2protocol-5.0.12.91115.0.tar.gz (73 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 73.7/73.7 kB 1.3 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting mpyq
  Downloading http://mirrors.aliyun.com/pypi/packages/ff/10/76041d97aa01e4d0f93481942b4faf5652123acdd90fbff4e40bb8d9024c/mpyq-0.2.5.tar.gz (8.7 kB)
  Preparing metadata (setup.py) ... done
Collecting websocket-client
  Downloading http://mirrors.aliyun.com/pypi/packages/d3/a3/63e9329c8cc9be6153e919e17d0ef5b60d537fed78564872951b95bcc17c/websocket_client-1.6.1-py3-none-any.whl (56 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 56.9/56.9 kB 1.3 MB/s eta 0:00:00
Collecting mock
  Downloading http://mirrors.aliyun.com/pypi/packages/6b/20/471f41173930550f279ccb65596a5ac19b9ac974a8d93679bcd3e0c31498/mock-5.1.0-py3-none-any.whl (30 kB)
Collecting enum34
  Downloading http://mirrors.aliyun.com/pypi/packages/63/f6/ccb1c83687756aeabbf3ca0f213508fcfb03883ff200d201b3a4c60cedcc/enum34-1.1.10-py3-none-any.whl (11 kB)
Collecting portpicker>=1.2.0
  Downloading http://mirrors.aliyun.com/pypi/packages/32/2d/440e4d7041fff89f28f483733eb617127aa866135c2dc719e05893f089e1/portpicker-1.6.0-py3-none-any.whl (16 kB)
Collecting requests
  Downloading http://mirrors.aliyun.com/pypi/packages/70/8e/0e2d847013cb52cd35b38c009bb167a1a26b2ce6cd6965bf26b47bc0bf44/requests-2.31.0-py3-none-any.whl (62 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.6/62.6 kB 2.1 MB/s eta 0:00:00
Collecting pygame
  Downloading http://mirrors.aliyun.com/pypi/packages/e8/95/bcfc7cd399dd736be3f8c01bf05b6d464337f933c17607979cda15a3ef34/pygame-2.5.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (14.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14.0/14.0 MB 2.9 MB/s eta 0:00:00
Requirement already satisfied: typing-extensions in /home/yzh/anaconda3/envs/pytorch/lib/python3.7/site-packages (from PySC2==4.0.0->-r requirements.txt (line 2)) (4.7.1)
Collecting psutil
  Downloading http://mirrors.aliyun.com/pypi/packages/c5/4f/0e22aaa246f96d6ac87fe5ebb9c5a693fbe8877f537a1022527c47ca43c5/psutil-5.9.8-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (288 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 288.2/288.2 kB 3.0 MB/s eta 0:00:00
Requirement already satisfied: six>=1.5 in /home/yzh/anaconda3/envs/pytorch/lib/python3.7/site-packages (from python-dateutil>=2.7->matplotlib==3.5.3->-r requirements.txt (line 1)) (1.16.0)
Collecting ordered-set<4.2.0,>=4.0.2
  Downloading http://mirrors.aliyun.com/pypi/packages/33/55/af02708f230eb77084a299d7b08175cff006dea4f2721074b92cdb0296c0/ordered_set-4.1.0-py3-none-any.whl (7.6 kB)
Collecting dm-env>=1.2
  Downloading http://mirrors.aliyun.com/pypi/packages/08/7e/36d548040e61337bf9182637a589c44da407a47a923ee88aec7f0e89867c/dm_env-1.6-py3-none-any.whl (26 kB)
Collecting immutabledict
  Downloading http://mirrors.aliyun.com/pypi/packages/63/24/2d70ce3bca941be9d81e7e701918b5eb4655e74f5ce7453d3fb6760edfa3/immutabledict-2.2.5-py3-none-any.whl (4.1 kB)
Collecting grpcio
  Downloading http://mirrors.aliyun.com/pypi/packages/11/ba/a462bbe7cbb5aabc6e8845be445eef42269a6bb8c39f83b950630674d070/grpcio-1.62.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.6 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.6/5.6 MB 3.0 MB/s eta 0:00:00
Collecting googleapis-common-protos
  Downloading http://mirrors.aliyun.com/pypi/packages/dc/a6/12a0c976140511d8bc8a16ad15793b2aef29ac927baa0786ccb7ddbb6e1c/googleapis_common_protos-1.63.0-py2.py3-none-any.whl (229 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 229.1/229.1 kB 2.3 MB/s eta 0:00:00
Collecting idna<4,>=2.5
  Downloading http://mirrors.aliyun.com/pypi/packages/e5/3e/741d8c82801c347547f8a2a06aa57dbb1992be9e948df2ea0eda2c8b79e8/idna-3.7-py3-none-any.whl (66 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 66.8/66.8 kB 3.1 MB/s eta 0:00:00
Collecting urllib3<3,>=1.21.1
  Downloading http://mirrors.aliyun.com/pypi/packages/d2/b2/b157855192a68541a91ba7b2bbcb91f1b4faa51f8bae38d8005c034be524/urllib3-2.0.7-py3-none-any.whl (124 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 124.2/124.2 kB 3.3 MB/s eta 0:00:00
Collecting charset-normalizer<4,>=2
  Downloading http://mirrors.aliyun.com/pypi/packages/c9/7a/6d8767fac16f2c80c7fa9f14e0f53d4638271635c306921844dc0b5fd8a6/charset_normalizer-3.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (136 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 136.8/136.8 kB 3.4 MB/s eta 0:00:00
Requirement already satisfied: certifi>=2017.4.17 in /home/yzh/anaconda3/envs/pytorch/lib/python3.7/site-packages (from requests->PySC2==4.0.0->-r requirements.txt (line 2)) (2022.12.7)
Requirement already satisfied: scipy in /home/yzh/anaconda3/envs/pytorch/lib/python3.7/site-packages (from sk-video->PySC2==4.0.0->-r requirements.txt (line 2)) (1.7.3)
Collecting dm-tree
  Downloading http://mirrors.aliyun.com/pypi/packages/89/42/1115cf34bb6cc5baba40e959382f8251012e97382a89801390679d79212f/dm_tree-0.1.8-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (153 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 153.8/153.8 kB 3.3 MB/s eta 0:00:00
Collecting googleapis-common-protos
  Downloading http://mirrors.aliyun.com/pypi/packages/f0/43/c9d8f75ddf08e2a0a27db243c13a700c3cc7ec615b545b697cf6f715ad92/googleapis_common_protos-1.62.0-py2.py3-none-any.whl (228 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 228.7/228.7 kB 2.7 MB/s eta 0:00:00
  Downloading http://mirrors.aliyun.com/pypi/packages/21/49/12996dc0238e017504dceea1d121a48bd49fb3f4416f40d59fc3e924b4f3/googleapis_common_protos-1.61.0-py2.py3-none-any.whl (230 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 230.9/230.9 kB 2.9 MB/s eta 0:00:00
  Downloading http://mirrors.aliyun.com/pypi/packages/a7/bc/416a1ffeba4dcd072bc10523dac9ed97f2e7fc4b760580e2bdbdc1e2afdd/googleapis_common_protos-1.60.0-py2.py3-none-any.whl (227 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 227.6/227.6 kB 3.1 MB/s eta 0:00:00
  Downloading http://mirrors.aliyun.com/pypi/packages/b3/b7/bbaa556e9ff0580f408c64ccf4db0c1414eec79e7151d33a10bc209ffb6d/googleapis_common_protos-1.59.1-py2.py3-none-any.whl (224 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 224.5/224.5 kB 2.7 MB/s eta 0:00:00
  Downloading http://mirrors.aliyun.com/pypi/packages/a7/8d/7ccf8f63ab0a768e13720262374c0d6a1489f7f23f1b89a16c92af452f09/googleapis_common_protos-1.59.0-py2.py3-none-any.whl (223 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 223.6/223.6 kB 3.1 MB/s eta 0:00:00
  Downloading http://mirrors.aliyun.com/pypi/packages/32/4e/ed585842aaa704d87495a0e99317aaa44c5007a597c05b995fa8cfc4dfbe/googleapis_common_protos-1.58.0-py2.py3-none-any.whl (223 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 223.0/223.0 kB 3.6 MB/s eta 0:00:00
  Downloading http://mirrors.aliyun.com/pypi/packages/76/b9/fc6a31a90e3c78cea00d209d48f1e5c6c9edc6b14f3039470c3f7fae60a1/googleapis_common_protos-1.57.1-py2.py3-none-any.whl (218 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 218.0/218.0 kB 2.9 MB/s eta 0:00:00
  Downloading http://mirrors.aliyun.com/pypi/packages/f0/2a/25d8c1ceedc5af97de37434c9c5e38ce28aaa45960aa2bd7aa215fc420c0/googleapis_common_protos-1.57.0-py2.py3-none-any.whl (217 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 218.0/218.0 kB 2.5 MB/s eta 0:00:00
  Downloading http://mirrors.aliyun.com/pypi/packages/e2/fd/d9efa2085bd762fba3a637eb3e36d76d72eb6e083d170aeaca65a75f1f9c/googleapis_common_protos-1.56.4-py2.py3-none-any.whl (211 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 211.7/211.7 kB 2.8 MB/s eta 0:00:00
Building wheels for collected packages: SMAC, mpyq, s2protocol
  Building wheel for SMAC (pyproject.toml) ... done
  Created wheel for SMAC: filename=SMAC-1.0.0-py3-none-any.whl size=29880 sha256=a7d9e0fcd76ac60e99764af590ae798f656e17af1441de9c7cd6c6dbad5faba3
  Stored in directory: /tmp/pip-ephem-wheel-cache-2md3a_ib/wheels/0a/c5/1e/bbd508094929d979fc3c913bae9e0f973ea98cfe05b8f5ae3b
  Building wheel for mpyq (setup.py) ... done
  Created wheel for mpyq: filename=mpyq-0.2.5-py3-none-any.whl size=6466 sha256=466d31544e11cc8a38fd183fbc93c552b809941564bc767788b66bb5d1285b5b
  Stored in directory: /home/yzh/.cache/pip/wheels/97/c5/f9/33657322af35dc40f10801593f3fde16b8165817c971bc6c79
  Building wheel for s2protocol (setup.py) ... done
  Created wheel for s2protocol: filename=s2protocol-5.0.12.91115.0-py3-none-any.whl size=664573 sha256=e39151b0686728683f5c960c27c465fbc0443da0f434e32b5d2a23a5ce33d9ef
  Stored in directory: /home/yzh/.cache/pip/wheels/c3/6d/ec/c108597932e9851d97de368e99be57fc07b6757e0b797a6f77
Successfully built SMAC mpyq s2protocol
Installing collected packages: mpyq, enum34, dm-tree, websocket-client, urllib3, torch, s2protocol, pygame, psutil, protobuf, ordered-set, mock, immutabledict, idna, grpcio, charset-normalizer, absl-py, sk-video, s2clientprotocol, requests, portpicker, googleapis-common-protos, dm-env, deepdiff, dm-env-rpc, PySC2, SMAC
  Attempting uninstall: torch
    Found existing installation: torch 1.13.1
    Uninstalling torch-1.13.1:
      Successfully uninstalled torch-1.13.1
Successfully installed PySC2-4.0.0 SMAC-1.0.0 absl-py-2.1.0 charset-normalizer-3.3.2 deepdiff-6.7.1 dm-env-1.6 dm-env-rpc-1.1.6 dm-tree-0.1.8 enum34-1.1.10 googleapis-common-protos-1.56.4 grpcio-1.62.2 idna-3.7 immutabledict-2.2.5 mock-5.1.0 mpyq-0.2.5 ordered-set-4.1.0 portpicker-1.6.0 protobuf-3.19.0 psutil-5.9.8 pygame-2.5.2 requests-2.31.0 s2clientprotocol-5.0.12.91115.0 s2protocol-5.0.12.91115.0 sk-video-1.1.10 torch-1.12.1 urllib3-2.0.7 websocket-client-1.6.1

但是在Quick Start时遇到如下报错,看起来是SC2的问题?刚接触强化学习,这方面还不太了解,要自己先下一个SC2吗?想问下应该怎么解决,谢谢!

(pytorch) yzh@yzh:~/MARL-Algorithms$ python main.py --map=3m --alg=iql
Init alg IQL
Init RolloutWorker
Run 0, time_steps 0
Traceback (most recent call last):
  File "main.py", line 34, in <module>
    runner.run(i)
  File "/home/yzh/MARL-Algorithms/runner.py", line 35, in run
    win_rate, episode_reward = self.evaluate()
  File "/home/yzh/MARL-Algorithms/runner.py", line 73, in evaluate
    _, episode_reward, win_tag, _ = self.rolloutWorker.generate_episode(epoch, evaluate=True)
  File "/home/yzh/anaconda3/envs/pytorch/lib/python3.7/site-packages/torch/autograd/grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "/home/yzh/MARL-Algorithms/common/rollout.py", line 28, in generate_episode
    self.env.reset()
  File "/home/yzh/anaconda3/envs/pytorch/lib/python3.7/site-packages/smac/env/starcraft2/starcraft2.py", line 403, in reset
    self._launch()
  File "/home/yzh/anaconda3/envs/pytorch/lib/python3.7/site-packages/smac/env/starcraft2/starcraft2.py", line 318, in _launch
    self._run_config = run_configs.get(version=self.game_version)
  File "/home/yzh/anaconda3/envs/pytorch/lib/python3.7/site-packages/pysc2/run_configs/__init__.py", line 36, in get
    return max(configs.values(), key=lambda c: c.priority())(version=version)
  File "/home/yzh/anaconda3/envs/pytorch/lib/python3.7/site-packages/pysc2/run_configs/platforms.py", line 175, in __init__
    super(Linux, self).__init__(base_dir, "SC2_x64", version=version, env=env)
  File "/home/yzh/anaconda3/envs/pytorch/lib/python3.7/site-packages/pysc2/run_configs/platforms.py", line 59, in __init__
    data_dir=base_dir, tmp_dir=None, version=version, cwd=cwd, env=env)
  File "/home/yzh/anaconda3/envs/pytorch/lib/python3.7/site-packages/pysc2/run_configs/lib.py", line 128, in __init__
    self.version = self._get_version(version)
  File "/home/yzh/anaconda3/envs/pytorch/lib/python3.7/site-packages/pysc2/run_configs/lib.py", line 236, in _get_version
    versions = self.get_versions(containing=game_version)
  File "/home/yzh/anaconda3/envs/pytorch/lib/python3.7/site-packages/pysc2/run_configs/platforms.py", line 90, in get_versions
    for v in os.listdir(versions_dir)
FileNotFoundError: [Errno 2] No such file or directory: '/home/yzh/StarCraftII/Versions

需要先装一个StarCraftII游戏;pysc2运行还依赖于这个,你去pysc2的仓库下面看下怎么装

好的,谢谢~