Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mujoco.FatalError: gladLoadGL error #5094

Closed
Guanyu-Peng opened this issue Feb 7, 2025 · 1 comment
Closed

mujoco.FatalError: gladLoadGL error #5094

Guanyu-Peng opened this issue Feb 7, 2025 · 1 comment
Labels

Comments

@Guanyu-Peng
Copy link

When I run the code of the algorithm of ACT below in google colab, report the error "/usr/local/envs/aloha/lib/python3.8/site-packages/glfw/init.py:917: GLFWError: (65550) b'X11: The DISPLAY environment variable is missing'
warnings.warn(message, GLFWError)
/usr/local/envs/aloha/lib/python3.8/site-packages/torchvision/models/_utils.py:208: UserWarning: The parameter 'pretrained' is deprecated since 0.13 and may be removed in the future, please use 'weights' instead.
warnings.warn(
/usr/local/envs/aloha/lib/python3.8/site-packages/torchvision/models/_utils.py:223: UserWarning: Arguments other than a weight enum or None for 'weights' are deprecated since 0.13 and may be removed in the future. The current behavior is equivalent to passing weights=ResNet18_Weights.IMAGENET1K_V1. You can also use weights=ResNet18_Weights.DEFAULT to get the most up-to-date weights.
warnings.warn(msg)
number of parameters: 83.92M
KL Weight 10
imitate_episodes.py:168: FutureWarning: You are using torch.load with weights_only=False (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only will be flipped to True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
loading_status = policy.load_state_dict(torch.load(ckpt_path))

Loaded: /content/drive/MyDrive/ckpt/policy_best.ckpt
/usr/local/envs/aloha/lib/python3.8/site-packages/glfw/init.py:917: GLFWError: (65537) b'The GLFW library is not initialized'
warnings.warn(message, GLFWError)
Traceback (most recent call last):
File "imitate_episodes.py", line 435, in
main(vars(parser.parse_args()))
File "imitate_episodes.py", line 95, in main
success_rate, avg_return = eval_bc(config, ckpt_name, save_episode=True)
File "imitate_episodes.py", line 209, in eval_bc
ts = env.reset()
File "/usr/local/envs/aloha/lib/python3.8/site-packages/dm_control/rl/control.py", line 89, in reset
observation = self._task.get_observation(self._physics)
File "/content/act/sim_env.py", line 110, in get_observation
obs['images']['top'] = physics.render(height=480, width=640, camera_id='top')
File "/usr/local/envs/aloha/lib/python3.8/site-packages/dm_control/mujoco/engine.py", line 223, in render
camera = Camera(
File "/usr/local/envs/aloha/lib/python3.8/site-packages/dm_control/mujoco/engine.py", line 711, in init
if self._physics.contexts.mujoco is not None:
File "/usr/local/envs/aloha/lib/python3.8/site-packages/dm_control/mujoco/engine.py", line 533, in contexts
self._make_rendering_contexts()
File "/usr/local/envs/aloha/lib/python3.8/site-packages/dm_control/mujoco/engine.py", line 519, in _make_rendering_contexts
mujoco_context = wrapper.MjrContext(self.model, render_context)
File "/usr/local/envs/aloha/lib/python3.8/site-packages/dm_control/mujoco/wrapper/core.py", line 603, in init
ptr = ctx.call(mujoco.MjrContext, model.ptr, font_scale)
File "/usr/local/envs/aloha/lib/python3.8/site-packages/dm_control/_render/executor/render_executor.py", line 138, in call
return func(*args, **kwargs)
mujoco.FatalError: gladLoadGL error"

"import torch
import numpy as np
import os
import pickle
import argparse
import matplotlib.pyplot as plt
from copy import deepcopy
from tqdm import tqdm
from einops import rearrange

from constants import DT
from constants import PUPPET_GRIPPER_JOINT_OPEN
from utils import load_data # data functions
from utils import sample_box_pose, sample_insertion_pose # robot functions
from utils import compute_dict_mean, set_seed, detach_dict # helper functions
from policy import ACTPolicy, CNNMLPPolicy
from visualize_episodes import save_videos

from sim_env import BOX_POSE

def eval_bc(config, ckpt_name, save_episode=True):
......

pre_process = lambda s_qpos: (s_qpos - stats['qpos_mean']) / stats['qpos_std']
post_process = lambda a: a * stats['action_std'] + stats['action_mean']

# load environment
if real_robot:
    from aloha_scripts.robot_utils import move_grippers # requires aloha
    from aloha_scripts.real_env import make_real_env # requires aloha
    env = make_real_env(init_node=True)
    env_max_reward = 0
else:
    from sim_env import make_sim_env
    env = make_sim_env(task_name)
    env_max_reward = env.task.max_reward

......
ts = env.reset()"

@Guanyu-Peng Guanyu-Peng added the bug label Feb 7, 2025
@EvanWiederspan
Copy link

From those logs, it looks like you've attempted to downgrade the Python version on the runtime. This is not supported - I recommend looking into whether you can use a newer library that does not require downgrading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants