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

ImportError: numpy.core.multiarray failed to import in Jetson environment #56

Open
Aki-zel opened this issue Nov 12, 2024 · 8 comments
Open

Comments

@Aki-zel
Copy link

Aki-zel commented Nov 12, 2024

I encountered an ImportError when running the demo script on my Jetson environment. The error message is as follows:

-> loaded checkpoint log/checkpoint-rs.tar (epoch: 18)
Traceback (most recent call last):
File "demo.py", line 124, in
demo(data_dir)
File "demo.py", line 120, in demo
vis_grasps(gg, cloud)
File "demo.py", line 108, in vis_grasps
gg.nms()
File "/home/ydfo/.local/lib/python3.8/site-packages/graspnetAPI/grasp.py", line 554, in nms
from grasp_nms import nms_grasp
File "grasp_nms.pyx", line 1, in init grasp_nms
ImportError: numpy.core.multiarray failed to import (auto-generated because you didn't call 'numpy.import_array()' after cimporting numpy; use 'numpy._import_array' to disable if you are certain you don't need it).
Environment:

Operating System: Ubuntu (Jetson)
Python Version: 3.8
NumPy Version: [1.20.3]
Jetson Model: [Jetson origin Nano]

@Sprinkle-X
Copy link

hello, that s what i met. Have you solved this?

@Aki-zel
Copy link
Author

Aki-zel commented Nov 26, 2024

hello, that s what i met. Have you solved this?

You need to clone the GraspNMS GitHub repository (https://github.com/GouMinghao/graspnms), then modify the grasp_nms.pyx file by adding np._import_array() after cimport numpy as np.

@Sprinkle-X
Copy link

I tried. But I meet new erro, like "ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject". Need I change other documents? Sorry for this more question.

@Aki-zel
Copy link
Author

Aki-zel commented Nov 28, 2024

I tried. But I meet new erro, like "ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject". Need I change other documents? Sorry for this more question.

update you numpy

@Sprinkle-X
Copy link

I tried. But I meet new erro, like "ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject". Need I change other documents? Sorry for this more question.

update you numpy

But I used numpy 1.20 and python 3.8 as well... T T

@Aki-zel
Copy link
Author

Aki-zel commented Nov 28, 2024

I tried. But I meet new erro, like "ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject". Need I change other documents? Sorry for this more question.

update you numpy

But I used numpy 1.20 and python 3.8 as well... T T

Try using numpy 1.23.5
You can refer to my pip list
1.txt

@Sprinkle-X
Copy link

I tried. But I meet new erro, like "ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject". Need I change other documents? Sorry for this more question.

update you numpy

But I used numpy 1.20 and python 3.8 as well... T T

Try using numpy 1.23.5 You can refer to my pip list 1.txt

!! That s so kind of you. I will try. Thanks a lot :)

@Sprinkle-X
Copy link

Updating numpy actually works, thanks a lot for your sugguestion ^^ Have a good night~

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