当前位置: 首页 > news >正文

Text2Reward学习笔记

1. 提示词

请问,“glew”是一个RL工程师常用的工具库吗?

2. 环境配置

2.1 安装 PyTorch-1.13.1

pip install torch==1.13.1+cu116 torchvision==0.14.1+cu116 \
torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu116

1.2 安装工具库

pip install stable-baselines3==1.8.0 wandb tensorboard \
-i https://pypi.tuna.tsinghua.edu.cn/simple
pip install langchain chromadb==0.4.0 \
-i https://pypi.tuna.tsinghua.edu.cn/simple

2. Troubleshooting

(1)出现错误“mujoco_py/gl/eglshim.c:4:10: fatal error: GL/glew.h: 没有那个文件或目录 4 | #include <GL/glew.h>”

错误信息如下:

>>> import mujoco_py
~/anaconda3/envs/text2reward/lib/python3.7/site-packages/mujoco_py/gl/eglshim.c:4:10: fatal error: GL/glew.h: 没有那个文件或目录4 | #include <GL/glew.h>|          ^~~~~~~~~~~
compilation terminated.
Traceback (most recent call last):File "~/anaconda3/envs/text2reward/lib/python3.7/site-packages/setuptools/_distutils/unixccompiler.py", line 186, in _compileself.spawn(compiler_so + cc_args + [src, '-o', obj] + extra_postargs)File "~/anaconda3/envs/text2reward/lib/python3.7/site-packages/setuptools/_distutils/ccompiler.py", line 1007, in spawnspawn(cmd, dry_run=self.dry_run, **kwargs)File "~/anaconda3/envs/text2reward/lib/python3.7/site-packages/setuptools/_distutils/spawn.py", line 71, in spawn"command {!r} failed with exit code {}".format(cmd, exitcode)
distutils.errors.DistutilsExecError: command '/usr/bin/gcc' failed with exit code 1During handling of the above exception, another exception occurred:Traceback (most recent call last):File "<stdin>", line 1, in <module>File "~/anaconda3/envs/text2reward/lib/python3.7/site-packages/mujoco_py/__init__.py", line 2, in <module>from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException... # 中间代码省略File "~/anaconda3/envs/text2reward/lib/python3.7/site-packages/setuptools/_distutils/unixccompiler.py", line 188, in _compileraise CompileError(msg)
distutils.errors.CompileError: command '/usr/bin/gcc' failed with exit code 1

由错误信息可以看出,这里其实是缺少GL工具,安装一下即可;

Gemini 2.0 Flash:GLEW(OpenGL Extension Wrangler Library)是一个OpenGL扩展管理库,用来管理和使用 OpenGL的新功能。

Note:glew可以尝试用conda安装。

可以参考官方命令;
也可以尝试使用以下命令安装:

sudo apt-get install libglew-dev libosmesa6-dev

(2)出现错误“FileNotFoundError: [Errno 2] No such file or directory: ‘patchelf’: ‘patchelf’”

错误信息如下:

>>> import mujoco_py
Traceback (most recent call last):File "<stdin>", line 1, in <module>File "~/anaconda3/envs/myenv/lib/python3.7/site-packages/mujoco_py/__init__.py", line 2, in <module>from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoExceptionFile "~/anaconda3/envs/myenv/lib/python3.7/site-packages/mujoco_py/builder.py", line 504, in <module>cymj = load_cython_ext(mujoco_path)File "~/anaconda3/envs/myenv/lib/python3.7/site-packages/mujoco_py/builder.py", line 110, in load_cython_extcext_so_path = builder.build()File "~/anaconda3/envs/myenv/lib/python3.7/site-packages/mujoco_py/builder.py", line 226, in buildbuilt_so_file_path = self._build_impl()File "~/anaconda3/envs/myenv/lib/python3.7/site-packages/mujoco_py/builder.py", line 297, in _build_implfix_shared_library(so_file_path, 'libOpenGL.so', 'libOpenGL.so.0')File "~/anaconda3/envs/myenv/lib/python3.7/site-packages/mujoco_py/builder.py", line 154, in fix_shared_librarysubprocess.check_call(['patchelf', '--remove-rpath', so_file])File "~/anaconda3/envs/myenv/lib/python3.7/subprocess.py", line 358, in check_callretcode = call(*popenargs, **kwargs)File "~/anaconda3/envs/myenv/lib/python3.7/subprocess.py", line 339, in callwith Popen(*popenargs, **kwargs) as p:File "~/anaconda3/envs/myenv/lib/python3.7/subprocess.py", line 800, in __init__restore_signals, start_new_session)File "~/anaconda3/envs/myenv/lib/python3.7/subprocess.py", line 1551, in _execute_childraise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'patchelf': 'patchelf'

这里其实就是提示缺少patchelf工具,安装一下即可;

Note: patchelf可以用conda来安装。

海螺AI: 在这里,patchelf 是一个用于修改 ELF 可执行文件和库的实用工具。在你的错误信息中,MuJoCo在构建时使用patchelf来修改共享库(主要是动态链接库 .so文件)的运行时路径(rpath)。


http://www.mrgr.cn/news/81543.html

相关文章:

  • 【hackmyvm】soul靶机wp
  • 关于开机挺快的,但是登录界面输入密码后,卡了许久许久
  • 【设计模式】适配器模式
  • (六)FT2232HL高速调试器之--SEGGER Embedded Studio的GDB调试问题解决
  • 主机ip地址是什么意思?主机ip地址在哪看
  • 解决Ubuntu下无法装载 Windows D盘的问题
  • 【强化学习】Stable-Baselines3学习笔记
  • Linux系统下安装webstorm
  • 华为管理变革之道:管理制度创新
  • 19、vue3组件通信
  • Java抽象工厂+单例模式
  • 【Java】Jackson序列化案例分析
  • 使用Grafana中按钮插件实现收发HTTP请求
  • 前端登录业务
  • 企业内训|高智能数据构建和多模态数据处理、Agent研发及AI测评技术内训-吉林省某汽车厂商
  • Chapter 03 复合数据类型-1
  • K8S部署CloudNativePG,忘记设置密码,修改管理员密码解决方案
  • [c++进阶(三)]单例模式及特殊类的设计
  • 安装k8s涉及命令(方便放到txt离线使用)
  • 攻防世界web第二题unseping
  • C++模板:编译时模拟Duck Typing
  • LLaMA-Factory GLM4-9B-CHAT LoRA 指令微调实战
  • 【Java 学习】深度剖析Java多态:从向上转型到向下转型,解锁动态绑定的奥秘,让代码更优雅灵活
  • 【stm32can】
  • CSharp: Oracle Stored Procedure query table
  • 重温设计模式--10、单例模式