question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

read_obj returns a face list of size 1 x 3 * n_faces, instead of 3 x n_faces

See original GitHub issue

🐛 Bug

When using read_obj from torch_geometric.io to load an obj file, the face field of the returned data object is of size 1 x 3 * n_faces instead of 3 x n_faces. This was not yet the case in v. 1.4.3.

To Reproduce

Steps to reproduce the behavior:

  1. Load obj file with torch_geometric.io.read_obj
  2. print(data.face.size())
  3. output: torch.Size([1, n_faces * 3]) (in this case [1, 1500])

Expected behavior

output: torch.Size([3, n_faces]). This is correct for read_ply.

Environment

  • OS: Linux (Ubuntu 20.04.1)
  • Python version: 3.7.4
  • PyTorch version: 1.6.0
  • CUDA/cuDNN version: 10.2
  • GCC version: 9.3.0
  • Any other relevant information: PyG version: 1.6.1

Additional context

I’m investigating the cause and will submit a pull request when I’ve fixed the issue.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rusty1scommented, Aug 26, 2020

Thanks for this issue and your valuable bug tracing. This is very helpful! I fixed the code by using t.split("/")[0]. For later releases, we can think of using an external library to allow for faster loading and less code maintenance.

I’m closing this issue for now, feel free to re-open in case there are any other concerns.

0reactions
rusty1scommented, Sep 3, 2020

Ok, I reverted to the old version for now 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

readobj source: R/loadobj.R
Read a Wavefront OBJ 3D scene file into an R list #' #' @param f Path to an OBJ file #' @param materialspath...
Read more >
readObj - File Exchange - MATLAB Central
This function reads vertices, faces, texture and normal information from a specified Obj file, and stores the information in a Matlab structure.
Read more >
trimesh/obj.py at main
Python library for loading and using triangular meshes. - trimesh/obj.py at main ... now we have clean- ish faces grouped by material and...
Read more >
Simple .obj mesh reader for MATLAB « Alec's Web Log
I wrote a little .obj file format reader in MATLAB. It only reads the vertices and faces of a triangle mesh (ignoring all...
Read more >
Python read obj
def read_obj(in_file): vertices = [] faces = [] for k, v in yield_file(in_file): if k == 'v': vertices.append(v) elif k == 'f': for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found