mujoco(-py) & gym & spinningup

mujoco-py1.50.1.68的安装

前面的要激活机子、下密钥以及安装包啥的我就不说了,重点记录我的问题及solution吧

pypi上能找到所有版本,然鹅github的tag只打到1.50.1.1然后就bump到2.0.2.0去了,也亏得提了个issue后老哥告诉我,不然我还真没找到…😅

安装完之后 按照mujoco-py 1.50.1.1版本的测试方法自测一下,连结果都跟官方一毛一样,我很满意!在这里插入图片描述

注意,请不要安装mujoco-py1.50.1.1版本的,务必安装1系列最新的1.50.1.68,因为前者只支持python3.5,后者可以支持py3.6,这对于spinningup来说很重要(spinningup requires python >= 3.6)
请不要用mujoco-py2.0.2.0的方法去测试mujoco-py1.50.1版本的…求求…

在mujoco-py的时候,会出现一大串response,只要不报错,都是小场面,不要慌
在这里插入图片描述

常见问题

测试的时候出现这个问题

>>> model = mujoco_py.load_model_from_path(dirname(dirname(mujoco_py.__file__))  +"/xmls/claw.xml")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "mujoco_py/cymj.pyx", line 131, in mujoco_py.cymj.load_model_from_path
Exception: Failed to load XML file: /home/xx/.local/lib/python3.6/site-packages/xmls/claw.xml. mj_loadXML error: b'XML parse error at line 0, column 0:\nFailed to open file\n'

去github上下载mujoco-py的源文件,将根目录下的xmls文件夹拷贝到/home/xx/.local/lib/python3.6/site-packages/(对应自己报错的文件夹)下即可。



gym

接着就是安装gym了,直接下载最新版,然后pip install -e gym[all]报如下错误:

ERROR: spinup 0.2.0 has requirement gym[atari,box2d,classic_control]~=0.15.3, but you'll have gym 0.17.2 which is incompatible.

好吧,换一下版本

git checkout -b your_branch_name 0.15.3

pytest测试结果:

=========================== short test summary info ===========================
FAILED gym/envs/tests/test_determinism.py::test_env[spec4] - pyglet.gl.lib.G...
FAILED gym/envs/tests/test_envs.py::test_env[spec0] - pyglet.gl.lib.GLExcept...
FAILED gym/envs/tests/test_envs.py::test_env[spec1] - pyglet.gl.lib.GLExcept...
FAILED gym/envs/tests/test_envs.py::test_env[spec2] - pyglet.gl.lib.GLExcept...
FAILED gym/envs/tests/test_envs.py::test_env[spec4] - pyglet.gl.lib.GLExcept...
FAILED gym/envs/tests/test_envs.py::test_env[spec5] - pyglet.gl.lib.GLExcept...
FAILED gym/envs/tests/test_envs.py::test_env[spec6] - pyglet.gl.lib.GLExcept...
FAILED gym/envs/tests/test_envs.py::test_env[spec19] - pyglet.gl.lib.GLExcep...
FAILED gym/envs/tests/test_envs.py::test_env[spec20] - pyglet.gl.lib.GLExcep...
FAILED gym/envs/tests/test_envs.py::test_env[spec22] - pyglet.gl.lib.GLExcep...
FAILED gym/envs/tests/test_envs.py::test_env[spec23] - pyglet.gl.lib.GLExcep...
FAILED gym/envs/tests/test_envs.py::test_env[spec25] - pyglet.gl.lib.GLExcep...
FAILED gym/wrappers/monitoring/tests/test_video_recorder.py::test_record_simple
===== 13 failed, 514 passed, 17 skipped, 59 warnings in 478.83s (0:07:58) =====

哪来这么多测试点过不了啊…不管了…到时候报错再看好了(感觉是openGL有问题
再按照reademe里面的建议跑下examples/agents/random_agent.py,又报错:

	raise GLException(msg)
pyglet.gl.lib.GLException: b'invalid enumerant'

一查issue,which 指向#366,运行了xvfb的命令之后报错:

ValueError: invalid literal for int() with base 10: '' 

摸到#439,深信无疑就是openGL的锅了。
按照SO教程安装,但似乎并没有安装成功:

$ glxinfo
name of display: localhost:11.0
display: localhost:11  screen: 0
direct rendering: No (If you want to find out why, try setting LIBGL_DEBUG=verbose)
server glx vendor string: SGI
server glx version string: 1.4
......

SO上面说可以重装驱动…emm以后再尝试吧…显卡驱动不敢随便重装的

存疑

  • GLX的安装还是没有搞定鸭
  • xvfb感觉挺常用的,但是始终不会鸭…#366有提到一个link可以学习
xvfb-run -s "-screen 0 1400x900x24" bash



spinningup

就按照官网的教程来即可。可以看到record啦 😉
在这里插入图片描述

综上

安装了spinningup,which supports python3.6,对应安装了gym 0.15,mujoco-py1.50

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值