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

ValueError: could not broadcast input array from shape (172,) into shape (344,) for certain mesh #2

Closed
tianyyiii opened this issue Nov 25, 2023 · 3 comments

Comments

@tianyyiii
Copy link

Thanks for your great work!
When I run segmentation on my customized meshes, for some mesh, it works without error. However, for some other meshes, I get the error

Traceback (most recent call last):
File "/home/jianfu/MeshCraft/SATR/scripts/single_dataset_example.py", line 18, in
segment(
File "/home/jianfu/MeshCraft/SATR/scripts/helper_functions.py", line 142, in segment
segmenter.set_mesh(mesh)
File "/home/jianfu/MeshCraft/SATR/meshseg/methods/segmentors.py", line 187, in set_mesh
self.compute_vertices_pairwise_dist()
File "/home/jianfu/MeshCraft/SATR/meshseg/methods/segmentors.py", line 276, in compute_vertices_pairwise_dist
self.vertices_distances[:, i] = x
ValueError: could not broadcast input array from shape (172,) into shape (344,)
How do I solve this?

@Samir55
Copy link
Owner

Samir55 commented Nov 25, 2023

Hi @tianyyiii, thank you for reaching out! it seems that the mesh may have duplicate vertices. You may need to preprocess it using Meshlab or similar software.

@tianyyiii
Copy link
Author

Thank you. It works!

@sizhe-wang
Copy link

I met the same problem. There may be another probability. So I record here and hope to be helpful.
I found this. This may be a bug of kaolin that if you import an obj mesh with color, the vertices in kaolin will contain RGB values. So that the mesh vertices may double.

I solved this by delete the color information of the obj mesh.

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