text2mesh icon indicating copy to clipboard operation
text2mesh copied to clipboard

Error with self-upload model

Open sunyuqian1997 opened this issue 3 years ago • 3 comments

Hello, thank you for sharing this amazing tool. I wonder if I can use my own model as the init model. I tried mine on Kaggle notebook, here is my version. Is there any requirement (like vertices count) for a model...? my notebook

It came up following issues when running main.py: The size of tensor a (3) must match the size of tensor b (4) at non-singleton dimension 2

full error:

/opt/conda/lib/python3.7/site-packages/clip/clip.py:23: UserWarning: PyTorch version 1.7.1 or higher is recommended warnings.warn("PyTorch version 1.7.1 or higher is recommended") ModuleList( (0): FourierFeatureTransform() (1): Linear(in_features=515, out_features=256, bias=True) (2): ReLU() (3): Linear(in_features=256, out_features=256, bias=True) (4): ReLU() (5): Linear(in_features=256, out_features=256, bias=True) (6): ReLU() (7): Linear(in_features=256, out_features=256, bias=True) (8): ReLU() (9): Linear(in_features=256, out_features=256, bias=True) (10): ReLU() ) ModuleList( (0): Linear(in_features=256, out_features=256, bias=True) (1): ReLU() (2): Linear(in_features=256, out_features=256, bias=True) (3): ReLU() (4): Linear(in_features=256, out_features=3, bias=True) ) ModuleList( (0): Linear(in_features=256, out_features=256, bias=True) (1): ReLU() (2): Linear(in_features=256, out_features=256, bias=True) (3): ReLU() (4): Linear(in_features=256, out_features=1, bias=True) ) 0%| | 0/750 [00:00<?, ?it/s]/opt/conda/lib/python3.7/site-packages/torch/nn/functional.py:1628: UserWarning: nn.functional.tanh is deprecated. Use torch.tanh instead. warnings.warn("nn.functional.tanh is deprecated. Use torch.tanh instead.") 0%| | 0/750 [00:00<?, ?it/s] Traceback (most recent call last): File "main.py", line 481, in run_branched(args) File "main.py", line 167, in run_branched update_mesh(mlp, network_input, prior_color, sampled_mesh, vertices) File "main.py", line 407, in update_mesh sampled_mesh.faces) RuntimeError: The size of tensor a (3) must match the size of tensor b (4) at non-singleton dimension 2

My model is here: ufo.zip Vertices: 90600 Faces: 90598 Triangles: 181196

image

sunyuqian1997 avatar Jan 15 '22 02:01 sunyuqian1997

Getting the same error when exporting a model from Blender as an obj - wondering if there is an issue with the export settings? It seems that some information is not getting exported which is why the tensor size is lower (3 rather than 4).

Did you ever manage to fix this?

mbrewster-art avatar Jan 17 '22 16:01 mbrewster-art

Exporting the same mesh as a .obj file from MeshLab solved this issue for me. It'd be nice to update code to understand .obj files not only came from MeshLab

spalman avatar Jan 24 '22 10:01 spalman

@mbrewster-art I got same error. I have verified that the system input must be a triangle mesh, and the normals must be per vertex.

Blender exports quad mesh as standard, so you need to change it to triangle mesh.

The first image is quad mesh, the seconds mesh is tri mesh.

develop_quad01

develop_tri02

You can change it in the export settings.

develop_blender04

Then, when using blender, the normals of each face are exported. I solved this problem by exporting an obj file without normals and using MeshLab to export normals per vertex. develop_meshlab03

KeitoTakaishi avatar Feb 10 '22 06:02 KeitoTakaishi