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

IndexError: index out of range #151

Open
LimitDr opened this issue Jul 5, 2023 · 0 comments
Open

IndexError: index out of range #151

LimitDr opened this issue Jul 5, 2023 · 0 comments

Comments

@LimitDr
Copy link

LimitDr commented Jul 5, 2023

Hello, I am currently using meshcnn to do some training, using my own data set, but the initial data set is not an obj file but a stl file, I transcode the stl file and put it into the model for inference , the following error occurred at the mesh_pool layer

Traceback (most recent call last): File "/home/lyle/anaconda3/envs/fastapi/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/home/lyle/桌面/FDU/UVNET_FastServer_previous/app/../app/views/data_views.py", line 311, in data_to_milvus model_tags, model_ids, file_embs, mesh_embs = get_bin_embs(uvnet_model, save_loader, File "/home/lyle/桌面/FDU/UVNET_FastServer_previous/app/../app/views/data_views.py", line 164, in get_bin_embs mesh_embs = meshcnn_model.get_emb() File "/home/lyle/桌面/FDU/UVNET_FastServer_previous/app/../app/MeshCNN_Collection/models/mesh_classifier.py", line 56, in get_emb _, emb = self.net(self.edge_features, self.mesh) File "/home/lyle/anaconda3/envs/fastapi/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl return forward_call(*input, **kwargs) File "/home/lyle/桌面/FDU/UVNET_FastServer_previous/app/../app/MeshCNN_Collection/models/networks.py", line 142, in forward x = getattr(self, 'pool{}'.format(i))(x, mesh) File "/home/lyle/桌面/FDU/UVNET_FastServer_previous/app/../app/MeshCNN_Collection/models/layers/mesh_pool.py", line 23, in __call__ return self.forward(fe, meshes) File "/home/lyle/桌面/FDU/UVNET_FastServer_previous/app/../app/MeshCNN_Collection/models/layers/mesh_pool.py", line 36, in forward self.__pool_main(mesh_index) File "/home/lyle/桌面/FDU/UVNET_FastServer_previous/app/../app/MeshCNN_Collection/models/layers/mesh_pool.py", line 52, in __pool_main value, edge_id = heappop(queue) IndexError: index out of range

After my observation, it seems that the edge_count failed to -1 in the __pool_edge method.
def __pool_edge(self, mesh, edge_id, mask, edge_groups): if self.has_boundaries(mesh, edge_id): return False elif self.__clean_side(mesh, edge_id, mask, edge_groups, 0)\ and self.__clean_side(mesh, edge_id, mask, edge_groups, 2) \ and self.__is_one_ring_valid(mesh, edge_id): self.__merge_edges[0] = self.__pool_side(mesh, edge_id, mask, edge_groups, 0) self.__merge_edges[1] = self.__pool_side(mesh, edge_id, mask, edge_groups, 2) mesh.merge_vertices(edge_id) mask[edge_id] = False MeshPool.__remove_group(mesh, edge_groups, edge_id) mesh.edges_count -= 1 return True else: return False # mesh.edges_count -= 1 return True

But almost 80% of my transcoding files have such errors. For these files, the edge_count will not be reduced by 1 at all. How to fix such errors?

The following is an obj sample of an error
https://drive.google.com/file/d/1yF7zMHlWrIF00UT6vrdimN1V9rQOkPjL/view?usp=drive_link

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

1 participant