拓冰建站拓冰建站
首页 / 资讯中心 / 正文

Maniskill仿真环境的obs记录代码

可能会遇到libstdc.so.6报错加上export LD_PRELOAD$CONDA_PREFIX/lib/libstdc.so.6自行记录RecordEpisode遇到坑记录obs的代码ManiSkill VLA 测试脚本importgymnasiumasgymimportmani_skill.envsfrommani_skill.utils.wrappersimportRecordEpisodeimportnumpyasnpimporttorchfromPILimportImageimportimageioimportos os.environ[CUDA_VISIBLE_DEVICES]3envgym.make(StackCube-v1,num_envs1,obs_modergb,control_modepd_ee_delta_pose,render_modergb_array,)obs,infoenv.reset(seed42)dir1./recordings/frames[]os.makedirs(dir1,exist_okTrue)forstepinrange(100):actionenv.action_space.sample()obs,reward,terminated,truncated,infoenv.step(action)rgbobs[sensor_data][base_camera][rgb]framergb[0].cpu().numpy()# img Image.fromarray(frame)frames.append(frame)ifstep%100:print(f{step}:{float(reward)})ifterminatedortruncated:breakenv.close()imageio.mimsave(dir1episode.gif,frames,fps30)
分享:

看完干货,该让你的企业上线了

免费需求沟通 · 48 小时内出具建站方案 · 河南本地可上门