Open fanloveoupao opened 1 year ago
mac 能跑吗
mac 能跑吗
可以。
/Users/lan/opt/anaconda3/envs/StreetFighterAI/lib/python3.8/site-packages/retro/,下面怎么没看到data文件夹?
我在运行python test.py时,遇到以下报错走不下去了,问了chatGPT,说是代码与模型不符,让我检查模型啥的,不懂,请大神帮忙解答,万分感谢:
(StreetFighterAI) C:\Users\jiaxin\StreetFighterAI\street-fighter-ai-master\main>python test.py
Wrapping the env with a Monitor
wrapper
Wrapping the env in a DummyVecEnv.
Wrapping the env in a VecTransposeImage.
Traceback (most recent call last):
File "test.py", line 53, in
我安装gym指定版本装不了 然后装了最新版本 然后呢 就跑不起来test.py 安装gym的报错如下: (StreetFighterAI) E:\LJM_D\street-fighter-ai-master\main>pip install gym==0.21.0 Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting gym==0.21.0 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/4b/48/920cea66177b865663fde5a9390a59de0ef3b642ad98106ac1d8717d7005/gym-0.21.0.tar.gz (1.5 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.5/1.5 MB 5.5 MB/s eta 0:00:00 Preparing metadata (setup.py) ... error error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully. │ exit code: 1 ╰─> [1 lines of output] error in gym setup command: 'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers. [end of output]
note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed
× Encountered error while generating package metadata. ╰─> See above for output.
note: This is an issue with the package mentioned above, not pip. hint: See above for details.
然后用最新gym跑test的报错如下:
(StreetFighterAI) E:\LJM_D\street-fighter-ai-master\main>python test.py
Traceback (most recent call last):
File "test.py", line 49, in
@yoyosaygood 可以把requirement.txt条件放松试试
gym>=0.22.0, <=0.25.2
gym-retro==0.8.0
stable-baselines3>=1.7.0
tensorboard==2.12.1
谢谢谢谢,已经解决了,非常感谢
On Wed, Jun 28, 2023 at 7:26 AM Hao Chen @.***> wrote:
@yoyosaygood https://github.com/yoyosaygood 可以把requirement.txt条件放松试试
gym>=0.22.0, <=0.25.2 gym-retro==0.8.0 stable-baselines3>=1.7.0 tensorboard==2.12.1
— Reply to this email directly, view it on GitHub https://github.com/linyiLYi/street-fighter-ai/issues/59#issuecomment-1610356433, or unsubscribe https://github.com/notifications/unsubscribe-auth/A7PPKWQP2HJ5XV42YUJO3QTXNNT2PANCNFSM6AAAAAAYHOOQ2Y . You are receiving this because you commented.Message ID: @.***>
请教下如何跑通的
你在m1下跑起来了?
@fr0zenrain 你是mac m1吗?
我运行test.py也出问题了,不过好像跟他们的不太一样。
C:\Users\21249.conda\envs\StreetFighterAI\lib\site-packages\stable_baselines3\common\save_util.py:166: UserWarning: Could not deserialize object observation_space. Consider using custom_objects
argument to replace this object.
Exception: __randomstate_ctor() takes from 0 to 1 positional arguments but 2 were given
warnings.warn(
Traceback (most recent call last):
File "test.py", line 53, in
@761046683 如果KeyError: "The observation_space and action_space were not given, can't verify new environments"报错的话, 将test.py的52~53行换成如下即可解决:
# 参考https://github.com/linyiLYi/street-fighter-ai/issues/16#issuecomment-1515463967
# if not RANDOM_ACTION:
# # 如果是你自己训练的模型
# model = PPO.load(os.path.join(MODEL_DIR, MODEL_NAME), env=env)
if not RANDOM_ACTION:
# 如果你使用的是linyiLYi提供的模型
keys = ['high', 'low', 'bounded_above', 'bounded_below']
setattr(env.observation_space, '_shape', (3,100,128))
for k in keys:
new_attr = getattr(env.observation_space, k).reshape(3,100,128)
setattr(env.observation_space, k, new_attr)
model = PPO.load(os.path.join(MODEL_DIR, MODEL_NAME), env=env,
custom_objects = {'observation_space': env.observation_space, 'action_space': env.action_space})
微信gknb_666 Traceback (most recent call last): File "C:\Users\chenj\Desktop\play\street-fighter-ai-master\street-fighter-ai-master\main\test.py", line 79, in
obs, reward, done, info = env.step(action) File "C:\Users\chenj\Desktop\play\street-fighter-ai-master\street-fighter-ai-master\main\street_fighter_custom_wrapper.py", line 71, in step self.env.render() File "C:\Users\chenj.conda\envs\StreetFighterAI\lib\site-packages\retro\retro_env.py", line 228, in render from gym.envs.classic_control.rendering import SimpleImageViewer ModuleNotFoundError: No module named 'gym.envs.classic_control.rendering'大佬,请问这个问题怎么解决
微信gknb_666回溯(最近一次调用):文件“C:\Users\chenj\Desktop\play\street-fighter-ai-master\street-fighter-ai-master\main\test.py”,第79行,在obs中,奖励,完成,info = env.step(action) 文件“C:\Users\chenj\Desktop\play\street-fighter-ai-master\street-fighter-ai-master\main\street_fighter_custom_wrapper.py”,第71行,在步骤self.env.render()文件 “C:\Users\chenj.conda\envs\StreetFighterAI\lib\site-packages\retro\retro_env.py”,第 228 行,从 gym.envs.classic_control.rendering 导入 SimpleImageViewer 渲染 ModuleNotFoundError: 没有名为 'gym.envs.classic_control.rendering'的大佬,请问这个问题怎么解决
还是要安装gym0.21,解决gym 0.21安装问题的方法。有时候新版本的setuptools或pip与旧的包存在不兼容性问题,pip install setuptools==65.5.0 pip==21 更新pip时,直接使用pip命令可能会出现问题。你应该按照错误消息中给出的建议,使用Python的-m选项来进行pip更新 python.exe -m pip install pip==21 -i https://pypi.tuna.tsinghua.edu.cn/simple 安装完成之后再下面用的清华源 pip install gym==0.21 -i https://pypi.tuna.tsinghua.edu.cn/simple
非常感谢
在 2023-10-20 18:36:23,"dybtom" @.***> 写道:
微信gknb_666回溯(最近一次调用):文件“C:\Users\chenj\Desktop\play\street-fighter-ai-master\street-fighter-ai-master\main\test.py”,第79行,在obs中,奖励,完成,info = env.step(action) 文件“C:\Users\chenj\Desktop\play\street-fighter-ai-master\street-fighter-ai-master\main\street_fighter_custom_wrapper.py”,第71行,在步骤self.env.render()文件 “C:\Users\chenj.conda\envs\StreetFighterAI\lib\site-packages\retro\retro_env.py”,第 228 行,从 gym.envs.classic_control.rendering 导入 SimpleImageViewer 渲染 ModuleNotFoundError: 没有名为 'gym.envs.classic_control.rendering'的大佬,请问这个问题怎么解决
还是要安装gym0.21,解决gym 0.21安装问题的方法。有时候新版本的setuptools或pip与旧的包存在不兼容性问题,pip install setuptools==65.5.0 pip==21 更新pip时,直接使用pip命令可能会出现问题。你应该按照错误消息中给出的建议,使用Python的-m选项来进行pip更新 python.exe -m pip install pip==21 -i https://pypi.tuna.tsinghua.edu.cn/simple 安装完成之后再下面用的清华源 pip install gym==0.21 -i https://pypi.tuna.tsinghua.edu.cn/simple
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
微信gknb_666回溯(最近一次调用):文件“C:\Users\chenj\Desktop\play\street-fighter-ai-master\street-fighter-ai-master\main\test.py”,第79行,在obs中,奖励,完成,info = env.step(action) 文件“C:\Users\chenj\Desktop\play\street-fighter-ai-master\street-fighter-ai-master\main\street_fighter_custom_wrapper.py”,第71行,在步骤self.env.render()文件 “C:\Users\chenj.conda\envs\StreetFighterAI\lib\site-packages\retro\retro_env.py”,第 228 行,从 gym.envs.classic_control.rendering 导入 SimpleImageViewer 渲染 ModuleNotFoundError: 没有名为 'gym.envs.classic_control.rendering'的大佬,请问这个问题怎么解决
还是要安装gym0.21,解决gym 0.21安装问题的方法。有时候新版本的setuptools或pip与旧的包存在不兼容性问题,pip install setuptools==65.5.0 pip==21 更新pip时,直接使用pip命令可能会出现问题。你应该按照错误消息中给出的建议,使用Python的-m选项来进行pip更新 python.exe -m pip install pip==21 -i https://pypi.tuna.tsinghua.edu.cn/simple 安装完成之后再下面用的清华源 pip install gym==0.21 -i https://pypi.tuna.tsinghua.edu.cn/simple
怎么办,我pip install setuptools==65.5.0 pip==21之后,系统让我C:\Users\future\pycharm_progect\pythonProject.venv\Scripts\python.exe -m pip install setuptools==65.5.0 pip==21,然后我的pip就不好用了,报错 from pip._vendor.six.moves import urllib, map, filter ModuleNotFoundError: No module named 'pip._vendor.six.moves' 求助,现在pip整个不好用了
微信gknb_666