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

Segmentation fault when running sequence planning #1

Closed
yuezhezhang opened this issue May 7, 2024 · 5 comments
Closed

Segmentation fault when running sequence planning #1

yuezhezhang opened this issue May 7, 2024 · 5 comments

Comments

@yuezhezhang
Copy link

Hi Yunsheng,

I am interested in your work and try to follow the steps to run the code. It seems the installation is good and I can also visualize the simulation of beam_assembly. But when I try to run the sequence planning:

python plan_sequence/run_seq_plan.py --dir beam_assembly --id original --planner dfs --generator heur-out --max-gripper 2 --base-part 6 --log-dir logs/beam_seq --early-term

It shows Segmentation fault (core dumped). Do you know what might be the reason and how to fix it. Thanks in advance!

@yunshengtian
Copy link
Owner

Hi @yuezhezhang ,

Thank you for your interest. I just tried a fresh install and ran the above command but I couldn't replicate this error. The command runs smoothly on my ubuntu machine (also tested using M1 MacBook).

However I believe this error should come from the physics simulation. This happens usually when I mess up the c++ simulation code, or pass the wrong arguments to the c++ simulation API calls, or forget to reinstall simulation after I change the simulation code.

To locate this error, could you please add some debugging prints on the python side and figure out which line triggers this error? Then I might have a better idea.

@anujay28
Copy link

anujay28 commented May 13, 2024

I am not sure if it helps, but I was getting some issues with version mismatch especially with torch-sparse. I used conda install pytorch-sparse -c pyg and it resolved the issue. Check your versions if you are using conda. Also when building the python bindings make sure its warning free and built 100%. It requires ninja and g++. Segmentation fault occurs usually when you are accessing a memory location which is not there.

@yunshengtian
Copy link
Owner

Thanks @anujay28 ! I also met some issues with torch-sparse and torch-scatter when doing fresh installs. Not sure what's the most elegant solution here but what worked for me is to install torch-sparse and torch-scatter separately after the other packages. I will update the installation instructions later regarding this issue.

@yuezhezhang
Copy link
Author

Hi @yunshengtian @anujay28:

Thank you for your reply! I think you are right, the torch-sparse and torch-scatter matter. For my case, when I try to create the environment from environment.yml (I guess it is related to the dependency of python), the pip packages try to inherit the cuda packages of other environments, which leads to mismatching when installing torch-sparse and torch-scatter.

My solution is:

conda create --name asap
conda activate asap
conda install pip=21.2.2
pip install numpy networkx matplotlib scipy pyglet rtree sortedcontainers scipy tqdm trimesh torch torch_geometric torch_sparse torch_scatter seaborn ikpy pyquaternion

This works for me and all the code runs smoothly!

@yunshengtian
Copy link
Owner

Glad to hear! I've also updated the instructions in README accordingly. Thanks again for your feedback.

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

3 participants