ARISE-Initiative / robosuite

robosuite: A Modular Simulation Framework and Benchmark for Robot Learning
https://robosuite.ai
Other
1.17k stars 374 forks source link

robosuite v1.1 ValueError: numpy.ndarray size changed, may indicate binary incompatibility. #293

Closed littlefiveRobot closed 2 years ago

littlefiveRobot commented 2 years ago

Dear Robosuite team,

Thanks for your great work in robosuite! i am a student. I want to run the MAPLE ,but when i installed my envirenment MAPLE,i found that my numpy version is incompatibility. But I install the env MAPLE followed requirements.txt(exactly maple.yml),so what is wrong?

Xia Xiaowu

littlefiveRobot commented 2 years ago

(maple) summer@xxw-OMEN:~/robosuite_maple$ python robosuite/demos/demo_random_action.py Traceback (most recent call last): File "robosuite/demos/demo_random_action.py", line 1, in from robosuite.controllers import load_controller_config File "/home/summer/robosuite_maple/robosuite/init.py", line 1, in from robosuite.environments.base import make File "/home/summer/robosuite_maple/robosuite/environments/init.py", line 1, in from .base import REGISTERED_ENVS, MujocoEnv File "/home/summer/robosuite_maple/robosuite/environments/base.py", line 2, in from mujoco_py import MjSim, MjRenderContextOffscreen File "/home/summer/anaconda3/envs/maple/lib/python3.8/site-packages/mujoco_py/init.py", line 3, in from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException File "/home/summer/anaconda3/envs/maple/lib/python3.8/site-packages/mujoco_py/builder.py", line 510, in cymj = load_cython_ext(mujoco_path) File "/home/summer/anaconda3/envs/maple/lib/python3.8/site-packages/mujoco_py/builder.py", line 101, in load_cython_ext mod = load_dynamic_ext('cymj', cext_so_path) File "/home/summer/anaconda3/envs/maple/lib/python3.8/site-packages/mujoco_py/builder.py", line 125, in load_dynamic_ext return loader.load_module() File "mujoco_py/cymj.pyx", line 1, in init mujoco_py.cymj ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 80 from PyObject

littlefiveRobot commented 2 years ago

Name Version Build Channel

_libgcc_mutex 0.1 main
absl-py 0.12.0 addict 2.4.0 anyio 3.3.1 argon2-cffi 20.1.0 py38h27cfd23_1
astunparse 1.6.3 async_generator 1.10 pyhd3eb1b0_0
attrs 21.4.0 pyhd3eb1b0_0
attrs 20.2.0 Babel 2.9.1 backcall 0.2.0 pyhd3eb1b0_0
bleach 3.3.0 pyhd3eb1b0_0
ca-certificates 2021.1.19 h06a4308_1
cachetools 4.2.1 certifi 2020.12.5 py38h06a4308_0
cffi 1.14.2 cffi 1.15.0 py38hd667e15_1
chardet 3.0.4 clang 5.0 click 7.1.2 cloudpickle 1.3.0 cycler 0.10.0 Cython 0.29.21 dbus 1.13.18 hb2f20db_0
decorator 4.4.2 pyhd3eb1b0_0
defusedxml 0.7.1 pyhd3eb1b0_0
deprecation 2.1.0 dill 0.3.4 entrypoints 0.3 py38_0
expat 2.3.0 h2531618_2
fasteners 0.15 Flask 1.0.2 flatbuffers 1.12 fontconfig 2.13.1 h6c09931_0
freetype 2.10.4 h5ab3b9f_0
future 0.18.2 gast 0.4.0 gitdb 4.0.2 gitdb2 2.0.6 GitPython 2.1.7 glfw 1.12.0 glib 2.68.0 h36276a3_0
google-api-core 1.26.0 google-api-python-client 1.12.8 google-auth 1.26.1 google-auth-httplib2 0.0.4 google-auth-oauthlib 0.4.4 google-cloud-core 1.6.0 google-cloud-storage 1.36.0 google-crc32c 1.1.2 google-pasta 0.2.0 google-resumable-media 1.2.0 googleapis-common-protos 1.52.0 grpcio 1.39.0 gst-plugins-base 1.14.0 h8213a91_2
gstreamer 1.14.0 h28cd5cc_2
gtimer 1.0.0b5 gym 0.17.2 h5py 3.1.0 httplib2 0.19.0 icu 58.2 he6710b0_3
idna 2.10 imageio 2.9.0 imageio-ffmpeg 0.4.4 importlib-metadata 3.7.3 py38h06a4308_1
importlib_metadata 3.7.3 hd3eb1b0_1
ipykernel 5.3.4 py38h5ca1d4c_0
ipython 7.22.0 py38hb070fc8_0
ipython_genutils 0.2.0 pyhd3eb1b0_1
ipywidgets 7.6.3 pyhd3eb1b0_1
itsdangerous 1.1.0 jedi 0.17.0 py38_0
Jinja2 2.11.2 jinja2 2.11.3 pyhd3eb1b0_0
joblib 1.0.1 jpeg 9b h024ee3a_2
json5 0.9.6 jsonschema 3.2.0 py_2
jupyter 1.0.0 py38_7
jupyter-core 4.6.3 jupyter-packaging 0.10.4 jupyter-server 1.11.0 jupyter_client 6.1.12 pyhd3eb1b0_0
jupyter_console 6.4.0 pyhd3eb1b0_0
jupyter_core 4.7.1 py38h06a4308_0
jupyterlab 3.1.12 jupyterlab-server 2.8.1 jupyterlab_pygments 0.1.2 py_0
jupyterlab_widgets 1.0.0 pyhd3eb1b0_1
keras 2.6.0 Keras-Preprocessing 1.1.2 kiwisolver 1.3.2 ld_impl_linux-64 2.33.1 h53a641e_7
libedit 3.1.20191231 h14c3975_1
libffi 3.3 he6710b0_2
libgcc-ng 9.1.0 hdf63c60_0
libpng 1.6.37 hbc83047_0
libsodium 1.0.18 h7b6447c_0
libstdcxx-ng 9.1.0 hdf63c60_0
libuuid 1.0.3 h1bed415_2
libxcb 1.14 h7b6447c_0
libxml2 2.9.10 hb55368b_3
llvmlite 0.32.1 lockfile 0.12.2 maple 0.2.1.dev0 Markdown 3.3.4 markupsafe 1.1.1 py38h7b6447c_0
matplotlib 3.4.3 mistune 0.8.4 py38h7b6447c_1000
monotonic 1.5 moviepy 1.0.3 mujoco-py 2.0.2.9 nbclassic 0.3.1 nbclient 0.5.3 pyhd3eb1b0_0
nbconvert 6.0.7 py38_0
nbformat 5.0.8 nbformat 5.1.3 pyhd3eb1b0_0
ncurses 6.2 he6710b0_1
nest-asyncio 1.5.1 pyhd3eb1b0_0
networkx 2.6.2 notebook 6.3.0 py38h06a4308_0
numba 0.49.1 numpy 1.19.5 nvisii 1.1.72 oauthlib 3.1.0 open3d 0.13.0 opencv-python 4.4.0.44 openssl 1.1.1k h27cfd23_0
opt-einsum 3.3.0 packaging 20.9 pyhd3eb1b0_0
pandas 1.3.3 pandoc 2.12 h06a4308_0
pandocfilters 1.4.3 py38h06a4308_1
parso 0.8.1 pyhd3eb1b0_0
pcre 8.44 he6710b0_0
pexpect 4.8.0 pyhd3eb1b0_3
pickleshare 0.7.5 pyhd3eb1b0_1003
Pillow 8.3.2 pip 20.2.2 py38_0
plotly 3.4.2 proglog 0.1.9 progressbar2 3.53.1 prometheus_client 0.9.0 pyhd3eb1b0_0
prompt-toolkit 3.0.17 pyh06a4308_0
prompt_toolkit 3.0.17 hd3eb1b0_0
protobuf 3.14.0 psutil 5.8.0 ptyprocess 0.7.0 pyhd3eb1b0_2
pyasn1 0.4.8 pyasn1-modules 0.2.8 pybullet 2.6.9 pycparser 2.20 py_2
pyglet 1.5.0 pygments 2.8.1 pyhd3eb1b0_0
pyparsing 2.4.7 pyhd3eb1b0_0
pyqt 5.9.2 py38h05f1152_4
pyrsistent 0.17.3 py38h7b6447c_0
python 3.8.5 h7579374_1
python-dateutil 2.8.1 pyhd3eb1b0_0
python-utils 2.5.6 pytz 2020.4 PyWavelets 1.1.1 PyYAML 5.4.1 pyzmq 20.0.0 py38h2531618_1
qt 5.9.7 h5867ecd_1
qtconsole 5.0.3 pyhd3eb1b0_0
qtpy 1.9.0 py_0
readline 8.0 h7b6447c_0
requests 2.24.0 requests-oauthlib 1.3.0 requests-unixsocket 0.2.0 retrying 1.3.3 robosuite 1.1.0 rsa 4.7 scikit-image 0.18.2 scikit-learn 0.24.2 scikit-video 1.1.11 scipy 1.5.2 send2trash 1.5.0 pyhd3eb1b0_1
setuptools 49.6.0 py38_0
sip 4.19.13 py38he6710b0_0
six 1.15.0 py38h06a4308_0
smmap 3.0.5 smmap2 3.0.1 sniffio 1.2.0 sqlite 3.33.0 h62c20be_0
tensorboard 2.6.0 tensorboard-data-server 0.6.1 tensorboard-plugin-wit 1.8.0 tensorboardX 2.4 tensorflow-estimator 2.6.0 tensorflow-gpu 2.6.0 termcolor 1.1.0 terminado 0.9.4 py38h06a4308_0
testpath 0.4.4 pyhd3eb1b0_0
threadpoolctl 2.2.0 tifffile 2021.8.8 tk 8.6.10 hbc83047_0
tomlkit 0.7.2 torch 1.6.0 torchvision 0.7.0 tornado 6.1 py38h27cfd23_0
tqdm 4.61.1 traitlets 5.0.5 pyhd3eb1b0_0
typing-extensions 3.7.4.3 uritemplate 3.0.1 urllib3 1.25.10 wcwidth 0.2.5 py_0
webencodings 0.5.1 py38_1
websocket-client 1.2.1 Werkzeug 1.0.1 wheel 0.37.1 pyhd3eb1b0_0
wheel 0.37.0 widgetsnbextension 3.5.1 py38_0
wrapt 1.12.1 xz 5.2.5 h7b6447c_0
zeromq 4.3.4 h2531618_0
zipp 3.4.1 pyhd3eb1b0_0
zlib 1.2.11 h7b6447c_3

snasiriany commented 2 years ago

Hi Xia,

Thanks for bringing this up to our attention. Seems like other mujoco_py users have had a similar issue: https://github.com/openai/mujoco-py/issues/607

That thread suggests three possible solutions:

  1. Change numpy to version 1.20.0: pip install numpy==1.20.0
  2. Change mujoco_py to version 2.0.2.5: pip install mujoco_py==2.0.2.5
  3. Another user also suggested: pip install mujoco-py==2.0.2.9 --no-cache-dir --no-binary :all: --no-build-isolation

Do any of these help solve the issue?

Soroush

littlefiveRobot commented 2 years ago

Oh,yes! I solved it by your third suggest(pip install mujoco-py==2.0.2.9 --no-cache-dir --no-binary :all: --no-build-isolation),thank you very much! Thank you for answering me!You are a good man haha! But it comes a new bug that is TypeError: 'NoneType' object is not iterable,I think it is also caused by env or a small mistake.Did you encounter this problem? Hope for your answer !

(maple) summer@xxw-OMEN:~/robosuite_maple$ python robosuite/demos/demo_random_action.py Welcome to robosuite v1.1.0!

  ;     /        ,--.
 ["]   ["]  ,<  |__**|
/[_]\  [~]\/    |//  |
 ] [   OOO      /o|__|

Here is a list of environments in the suite:

[0] Cleanup [1] Door [2] Lift [3] NutAssembly [4] NutAssemblyRound [5] NutAssemblySingle [6] NutAssemblySquare [7] PegInHole [8] PickPlace [9] PickPlaceBread [10] PickPlaceCan [11] PickPlaceCereal [12] PickPlaceMilk [13] PickPlaceSingle [14] Stack [15] Wipe

Choose an environment to run (enter a number from 0 to 15): 0 Here is a list of available robots:

[0] IIWA [1] Jaco [2] Kinova3 [3] Panda [4] Sawyer [5] UR5e

Choose a robot (enter a number from 0 to 5): 2 Here is a list of controllers in the suite:

[0] JOINT_VELOCITY - Joint Velocity [1] JOINT_TORQUE - Joint Torque [2] JOINT_POSITION - Joint Position [3] OSC_POSITION - Operational Space Control (Position Only) [4] OSC_POSE - Operational Space Control (Position + Orientation) [5] OSC_POSITION_YAW - Operational Space Control (Position + Yaw) [6] IK_POSE - Inverse Kinematics Control (Position + Orientation) (Note: must have PyBullet installed)

Choose a controller for the robot (enter a number from 0 to 6): 2

Press "H" to show the viewer control panel. Traceback (most recent call last): File "robosuite/demos/demo_random_action.py", line 50, in env = suite.make( File "/home/summer/robosuite_maple/robosuite/environments/base.py", line 41, in make return REGISTERED_ENVS[env_name](*args, **kwargs) File "/home/summer/robosuite_maple/robosuite/environments/manipulation/cleanup.py", line 188, in init super().init( File "/home/summer/robosuite_maple/robosuite/environments/manipulation/manipulation_env.py", line 148, in init super().init( File "/home/summer/robosuite_maple/robosuite/environments/robot_env.py", line 167, in init self.skill_controller = SkillController(self, skill_config) File "/home/summer/robosuite_maple/robosuite/controllers/skill_controller.py", line 29, in init self._setup_config(config) File "/home/summer/robosuite_maple/robosuite/controllers/skill_controller.py", line 46, in _setup_config self._config.update(config) TypeError: 'NoneType' object is not iterable

littlefiveRobot commented 2 years ago

And if I change my mujoco_py to version 2.0.2.5,it faces the same question.(I'm a novice)

snasiriany commented 2 years ago

Hi Xia,

Great to hear that the mujoco_py issue was resolved. Regarding the new issue that you mentioned -- that script demo_random_action.py hasn't been updated to work with the MAPLE framework, so the error is expected. In fact many of the programs under robosuite/demos and robosuite/scripts are probably stale and are not compatible with MAPLE. In the future I will address these issues. For now, robosuite/scripts/collect_human_demonstrations.py does work, and it allows you to interactively play with the environment. Let me know if this specific script brings any issues for you.

Soroush

littlefiveRobot commented 2 years ago

Dear Soroush,

I am very glad to hear from you.Thank you for your patience and thoughtful answer.I had known what you expressed.So I run the code robosuite/scripts/collect_human_demonstrations.py ,it does work,which verified that my robosuite environment is OK.

To be honest,I'm a 1st year master student and interested in your paper Augmenting Reinforcement Learning with Behavior Primitives for Diverse Manipulation Tasks . So I want to run it,But I still encounter a question.I had tried to solve it. I see stochastic file in maple/torch/networks but why in the build/lib/maple/torch/networks I can't find stochastic, I followed your README.md to install maple==0.2.1.dev0 .Is there something wrong with me?Maybe I still need your help.

Xia Xiaowu

(maple) summer@xxw-OMEN:~/maple$ python scripts/train.py --env stack No personal conf_private.py found. doodad not detected Traceback (most recent call last): File "scripts/train.py", line 4, in from maple.launchers.robosuite_launcher import experiment File "/home/summer/anaconda3/envs/maple/lib/python3.8/site-packages/maple-0.2.1.dev0-py3.8.egg/maple/launchers/robosuite_launcher.py", line 8, in from maple.torch.sac.policies import ( File "/home/summer/anaconda3/envs/maple/lib/python3.8/site-packages/maple-0.2.1.dev0-py3.8.egg/maple/torch/sac/policies/init.py", line 1, in from maple.torch.sac.policies.base import ( File "/home/summer/anaconda3/envs/maple/lib/python3.8/site-packages/maple-0.2.1.dev0-py3.8.egg/maple/torch/sac/policies/base.py", line 17, in from maple.torch.networks.stochastic.distribution_generator import ( ModuleNotFoundError: No module named 'maple.torch.networks.stochastic'

snasiriany commented 2 years ago

Did you try pip install -e . in the root directory of this repository? This is important. If you do this, I think everything will work. But if you run pip maple==0.2.1.dev0 I don't think this will work. So I'd suggest uninstalling the maple repo, and reinstalling by running pip install -e . from the root folder of the maple repo.

MrGZC commented 1 year ago

Dear Robosuite team,

Dear Robosuite team,

I have tried the three ways you have suggested. However, I need help solving the problem. The output when I perform the order "env = gym.make('Safexp-PointGoal1-v0')" is

Traceback (most recent call last): File "", line 1, in File "/home/user/gzc3090/anaconda3/envs/safetygym/lib/python3.8/site-packages/gym/envs/registration.py", line 156, in make return registry.make(id, kwargs) File "/home/user/gzc3090/anaconda3/envs/safetygym/lib/python3.8/site-packages/gym/envs/registration.py", line 101, in make env = spec.make(kwargs) File "/home/user/gzc3090/anaconda3/envs/safetygym/lib/python3.8/site-packages/gym/envs/registration.py", line 72, in make cls = load(self.entry_point) File "/home/user/gzc3090/anaconda3/envs/safetygym/lib/python3.8/site-packages/gym/envs/registration.py", line 17, in load mod = importlib.import_module(mod_name) File "/home/user/gzc3090/anaconda3/envs/safetygym/lib/python3.8/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1014, in _gcd_import File "", line 991, in _find_and_load File "", line 975, in _find_and_load_unlocked File "", line 671, in _load_unlocked File "", line 843, in exec_module File "", line 219, in _call_with_frames_removed File "/home/user/gzc3090/code/safety-gym/safety_gym/envs/mujoco.py", line 9, in from safety_gym.envs.engine import * # noqa File "/home/user/gzc3090/code/safety-gym/safety_gym/envs/engine.py", line 9, in import mujoco_py File "/home/user/gzc3090/anaconda3/envs/safetygym/lib/python3.8/site-packages/mujoco_py/init.py", line 3, in from mujoco_py.builder import cymj, ignore_mujoco_warnings, functions, MujocoException File "/home/user/gzc3090/anaconda3/envs/safetygym/lib/python3.8/site-packages/mujoco_py/builder.py", line 506, in cymj = load_cython_ext(mujoco_path) File "/home/user/gzc3090/anaconda3/envs/safetygym/lib/python3.8/site-packages/mujoco_py/builder.py", line 101, in load_cython_ext mod = load_dynamic_ext('cymj', cext_so_path) File "/home/user/gzc3090/anaconda3/envs/safetygym/lib/python3.8/site-packages/mujoco_py/builder.py", line 125, in load_dynamic_ext return loader.load_module() File "mujoco_py/cymj.pyx", line 1, in init mujoco_py.cymj ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 80 from PyObject

============================================================== When I tried " pip install numpy==1.20.0", the output is ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. safety-gym 0.0.0 requires numpy~=1.17.4, but you have numpy 1.20.0 which is incompatible.

The other two orders can't work well also. And the packages I installed are:

Name Version Build Channel

_libgcc_mutex 0.1 main _openmp_mutex 5.1 1_gnu ca-certificates 2023.05.30 h06a4308_0 cffi 1.15.1 pypi_0 pypi cloudpickle 1.2.2 pypi_0 pypi cython 0.29.36 pypi_0 pypi fasteners 0.18 pypi_0 pypi future 0.18.3 pypi_0 pypi glfw 2.6.2 pypi_0 pypi gym 0.15.7 pypi_0 pypi imageio 2.31.1 pypi_0 pypi joblib 0.14.1 pypi_0 pypi ld_impl_linux-64 2.38 h1181459_1 libffi 3.3 he6710b0_2 libgcc-ng 11.2.0 h1234567_1 libgomp 11.2.0 h1234567_1 libstdcxx-ng 11.2.0 h1234567_1 mujoco-py 2.0.2.7 pypi_0 pypi ncurses 6.4 h6a678d5_0 numpy 1.17.5 pypi_0 pypi openssl 1.1.1u h7f8727e_0 patchelf 0.17.2.1 pypi_0 pypi pillow 10.0.0 pypi_0 pypi pip 23.1.2 py38h06a4308_0 pycparser 2.21 pypi_0 pypi pyglet 1.5.0 pypi_0 pypi python 3.8.13 haa1d7c7_1 readline 8.2 h5eee18b_0 safety-gym 0.0.0 dev_0 scipy 1.8.1 pypi_0 pypi setuptools 67.8.0 py38h06a4308_0 six 1.16.0 pypi_0 pypi sqlite 3.41.2 h5eee18b_0 tk 8.6.12 h1ccaba5_0 wheel 0.38.4 py38h06a4308_0 xmltodict 0.12.0 pypi_0 pypi xz 5.4.2 h5eee18b_0 zlib 1.2.13 h5eee18b_0

I hope to receive your reply, best, I wish you the best of luck.