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

RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd #15

Open
DanielTakeshi opened this issue Jul 12, 2021 · 3 comments

Comments

@DanielTakeshi
Copy link

I followed the three installation steps for my Ubuntu 18.04 machine to create a conda environment named ravens. The installation seems to have proceeded correctly. However, running the example shows this:

(ravens) seita@starship:~/ravens (master) $ python ravens/demos.py --assets_root=./ravens/environments/assets/ --disp=True --task=block-insertion --mode=train --n=10
2021-07-11 20:47:57.446709: I tensorflow/stream_executor/platform/default/dso_loader.cc:48] Successfully opened dynamic library libcudart.so.10.1
pybullet build time: May 11 2021 10:00:39
RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
Traceback (most recent call last):
  File "ravens/demos.py", line 25, in <module>
    from ravens import tasks
  File "/home/seita/ravens/ravens/__init__.py", line 18, in <module>
    from ravens import agents
  File "/home/seita/ravens/ravens/agents/__init__.py", line 18, in <module>
    from ravens.agents.conv_mlp import PickPlaceConvMlpAgent
  File "/home/seita/ravens/ravens/agents/conv_mlp.py", line 22, in <module>
    from ravens.models import mdn_utils
  File "/home/seita/ravens/ravens/models/__init__.py", line 18, in <module>
    from ravens.models.attention import Attention
  File "/home/seita/ravens/ravens/models/attention.py", line 21, in <module>
    from ravens.utils import utils
  File "/home/seita/ravens/ravens/utils/utils.py", line 28, in <module>
    import pybullet as p
ImportError: numpy.core.multiarray failed to import

This error is reported elsewhere, for example:

Most fixes suggest upgrading the numpy version. Here is the pastebin of the result of conda list showing that I'm using numpy 1.18.5. However, upgrading numpy does not succeed because TensorFlow 2.3.0 has a strict numpy dependency:

(ravens) seita@starship:~/ravens (master) $ pip install numpy --upgrade
Requirement already satisfied: numpy in /home/seita/miniconda3/envs/ravens/lib/python3.7/site-packages (1.18.5)
Collecting numpy
  Downloading numpy-1.21.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.7 MB)
     |████████████████████████████████| 15.7 MB 5.8 MB/s 
Installing collected packages: numpy
  Attempting uninstall: numpy
    Found existing installation: numpy 1.18.5
    Uninstalling numpy-1.18.5:
      Successfully uninstalled numpy-1.18.5
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.
tensorflow 2.3.0 requires numpy<1.19.0,>=1.16.0, but you have numpy 1.21.0 which is incompatible.
Successfully installed numpy-1.21.0

The strange part is, I can actually run the data collection and training scripts, after upgrading numpy. However, because TensorFlow 2.3.0 is supposed to be incompatible (e.g., see here) it's not clear to me that this is an ideal situation. There may be some silent errors or unexpected code usage with the more recent numpy versions.

Is anyone able to reproduce this from a clean installation?

@TriBall3
Copy link

TriBall3 commented Apr 1, 2022

Hello! May I ask you a question? I learned that you proposed Deformable-Ravens based on Ravens, so can you test the model on the source code of Ravens? I have some problems in this link, could you help me solve them?
https://github.com/google-research/ravens/issues/25

@zwbx
Copy link

zwbx commented Jan 9, 2024

Same error. How do you fix it in the end?

@zhaianbang
Copy link

python train.py
pybullet build time: Apr 16 2024 14:14:25
RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xd . Check the section C-API incompatibility at the Troubleshooting ImportError section at https://numpy.org/devdocs/user/troubleshooting-importerror.html#c-api-incompatibility for indications on how to solve this problem .
Traceback (most recent call last):
File "train.py", line 7, in
import utils
File "/home/tchen/Desktop/zab2024/vla_grasp_zju/Vision-Language-Grasping/utils.py", line 3, in
import pybullet as p
ImportError: numpy.core.multiarray failed to import

in: https://github.com/zhaianbang/Vision-Language-Grasping, in this project, i meet this problem too.

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

4 participants