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

run python3 train_hierarchical_decision_mamba.py --env_name ant --dataset medium-expert --high_n_layer 6 --high_d_model 128 --low_n_layer 6 --low_d_model 128 --K 20 #1

Open
kwd2233 opened this issue Jul 12, 2024 · 1 comment

Comments

@kwd2233
Copy link

kwd2233 commented Jul 12, 2024

DeprecationWarning: dep_util is Deprecated. Use functions from setuptools instead.
from distutils.dep_util import newer, newer_group
Compiling /home/zhang/miniconda3/envs/DecisionMamba/lib/python3.9/site-packages/mujoco_py/cymj.pyx because it changed.
[1/1] Cythonizing /home/zhang/miniconda3/envs/DecisionMamba/lib/python3.9/site-packages/mujoco_py/cymj.pyx
performance hint: /home/zhang/miniconda3/envs/DecisionMamba/lib/python3.9/site-packages/mujoco_py/cymj.pyx:67:5: Exception check on 'c_warning_callback' will always require the GIL to be acquired.
Possible solutions:
1. Declare 'c_warning_callback' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
2. Use an 'int' return type on 'c_warning_callback' to allow an error code to be returned.
performance hint: /home/zhang/miniconda3/envs/DecisionMamba/lib/python3.9/site-packages/mujoco_py/cymj.pyx:104:5: Exception check on 'c_error_callback' will always require the GIL to be acquired.
Possible solutions:
1. Declare 'c_error_callback' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
2. Use an 'int' return type on 'c_error_callback' to allow an error code to be returned.

Error compiling Cython file:

...
See c_warning_callback, which is the C wrapper to the user defined function
'''
global py_warning_callback
global mju_user_warning
py_warning_callback = warn
mju_user_warning = c_warning_callback
^

/home/zhang/miniconda3/envs/DecisionMamba/lib/python3.9/site-packages/mujoco_py/cymj.pyx:92:23: Cannot assign type 'void (const char ) except * nogil' to 'void ()(const char *) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to the type of 'c_warning_callback'.

Error compiling Cython file:

...
See c_warning_callback, which is the C wrapper to the user defined function
'''
global py_error_callback
global mju_user_error
py_error_callback = err_callback
mju_user_error = c_error_callback
^

/home/zhang/miniconda3/envs/DecisionMamba/lib/python3.9/site-packages/mujoco_py/cymj.pyx:127:21: Cannot assign type 'void (const char ) except * nogil' to 'void ()(const char *) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to the type of 'c_error_callback'.
Traceback (most recent call last):
File "/home/zhang/HierarchicalDecisionMamba-main/train_hierarchical_decision_mamba.py", line 5, in
import d4rl
File "/home/zhang/miniconda3/envs/DecisionMamba/lib/python3.9/site-packages/d4rl/init.py", line 14, in
import d4rl.locomotion
File "/home/zhang/miniconda3/envs/DecisionMamba/lib/python3.9/site-packages/d4rl/locomotion/init.py", line 2, in
from d4rl.locomotion import ant
File "/home/zhang/miniconda3/envs/DecisionMamba/lib/python3.9/site-packages/d4rl/locomotion/ant.py", line 20, in
import mujoco_py
File "/home/zhang/miniconda3/envs/DecisionMamba/lib/python3.9/site-packages/mujoco_py/init.py", line 2, in
from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException
File "/home/zhang/miniconda3/envs/DecisionMamba/lib/python3.9/site-packages/mujoco_py/builder.py", line 504, in
cymj = load_cython_ext(mujoco_path)
File "/home/zhang/miniconda3/envs/DecisionMamba/lib/python3.9/site-packages/mujoco_py/builder.py", line 110, in load_cython_ext
cext_so_path = builder.build()
File "/home/zhang/miniconda3/envs/DecisionMamba/lib/python3.9/site-packages/mujoco_py/builder.py", line 226, in build
built_so_file_path = self._build_impl()
File "/home/zhang/miniconda3/envs/DecisionMamba/lib/python3.9/site-packages/mujoco_py/builder.py", line 296, in _build_impl
so_file_path = super()._build_impl()
File "/home/zhang/miniconda3/envs/DecisionMamba/lib/python3.9/site-packages/mujoco_py/builder.py", line 239, in _build_impl
dist.ext_modules = cythonize([self.extension])
File "/home/zhang/miniconda3/envs/DecisionMamba/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize
cythonize_one(*args)
File "/home/zhang/miniconda3/envs/DecisionMamba/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: /home/zhang/miniconda3/envs/DecisionMamba/lib/python3.9/site-packages/mujoco_py/cymj.pyx
How can this error
be resolved? Has anyone encountered this before?

@kwd2233 kwd2233 closed this as completed Jul 12, 2024
@kwd2233 kwd2233 reopened this Jul 12, 2024
@meowatthemoon
Copy link
Owner

I had a similar Cython problem when I was using an older python version. Try to upgrade python to >=3.11

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

No branches or pull requests

2 participants