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

Error with self-upload model #11

Open
sunyuqian1997 opened this issue Jan 15, 2022 · 3 comments
Open

Error with self-upload model #11

sunyuqian1997 opened this issue Jan 15, 2022 · 3 comments

Comments

@sunyuqian1997
Copy link

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

@mbrewster-art
Copy link

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?

@spalman
Copy link

spalman commented Jan 24, 2022

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

@KeitoTakaishi
Copy link

KeitoTakaishi commented Feb 10, 2022

@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

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

4 participants