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: Internal PLY loading error. Type has no defined byte size. #99

Open
GregorKobsik opened this issue Oct 16, 2024 · 2 comments

Comments

@GregorKobsik
Copy link

GregorKobsik commented Oct 16, 2024

Hi,

Description: I tried to load a .PLY file with your library, unfortunately it does not work as intended - resulting in an error: RuntimeError: Internal PLY loading error. Type has no defined byte size.

Version: point-cloud-utils-0.31.0

Workaround: I can still load the files with plydata = PlyData.read(input_file), extract the vertices and faces, and process the data further with your library. Maybe this workaround helps others with a similar issues.

Sincerely, Gregor


I also attached an exemplary file: 22831bc32bd744d3f06dea205edf9704.zip

Meshlab is loading the file correctly:
image

Error Log:

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
Cell In[66], line 14
     12 # load cuboid and sample point cloud
     13 print(input_file)
---> 14 cuboid_verts, cuboid_faces = pcu.load_mesh_vf(input_file)

File /clusterstorage/gkobsik/miniforge3/envs/py3d/lib/python3.10/site-packages/point_cloud_utils/_mesh_io.py:640, in load_mesh_vf(filename, dtype)
    627 def load_mesh_vf(filename, dtype=float):
    628     """
    629     Load a triangle mesh consisting of vertex positions and face indices.
    630     Point Cloud Utils currently supports PLY, OBJ, STL, OFF, VRML 2.0, X3D, COLLADA, 3DS.
   (...)
    638       f : An (m, 3)-shaped integer numpy array of face indices into v
    639     """
--> 640     ret = load_triangle_mesh(filename, dtype=dtype)
    641     return ret.v, ret.f

File /clusterstorage/gkobsik/miniforge3/envs/py3d/lib/python3.10/site-packages/point_cloud_utils/_mesh_io.py:556, in load_triangle_mesh(filename, dtype)
    544 """
    545 Load a triangle mesh into a `TriangleMesh` class.
    546 Point Cloud Utils currently supports PLY, OBJ, STL, OFF, VRML 2.0, X3D, COLLADA, 3DS.
   (...)
    553   mesh : A `TriangleMesh` class containing the loaded mesh
    554 """
    555 ret = TriangleMesh()
--> 556 ret.load(filename, dtype=dtype)
    557 return ret

File /clusterstorage/gkobsik/miniforge3/envs/py3d/lib/python3.10/site-packages/point_cloud_utils/_mesh_io.py:344, in TriangleMesh.load(self, filename, dtype)
    341         os.chdir(previous_dir)
    343 with pushd(mesh_root_path):
--> 344     mesh_dict = load_mesh_internal(mesh_filename, dtype)
    346 self.textures = mesh_dict["textures"]
    347 self.normal_maps = mesh_dict["normal_maps"]

RuntimeError: Internal PLY loading error. Type has no defined byte size.
@NIRVANALAN
Copy link

Same error here, but this only happens on py=3.9. using py=3.10 on a same machine resolves this issue.

@ph03
Copy link

ph03 commented Nov 27, 2024

Running into the same issue / error (tested with point-cloud-utils==0.30.2 and 0.31.0) using py=3.11.

The python version seems to not be related on my end, but I found that problem can be circumvented using numpy==1.26.4 (the issue is popping up for numpy==2.1.3).

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