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

设置sacle为0.3的时候报错 #54

Open
SunyuKy opened this issue May 22, 2023 · 2 comments
Open

设置sacle为0.3的时候报错 #54

SunyuKy opened this issue May 22, 2023 · 2 comments

Comments

@SunyuKy
Copy link

SunyuKy commented May 22, 2023

在stage 0,当我没有为scale设置参数时是正常的,但是我想要更好的效果,所以设置bound 16,scale 0.3,确实取得了更高的psnr,但是在输出模型的时候报了以下错误,经过还原参数发型是设置了scale后出现的,请问你有出现过类似的情况吗?经过debug发现是在renderer.py 499行: vertices, triangles = mcubes.marching_cubes(-sigmas, 0) 执行后,vertices, triangles的值为空

‘’‘’
Traceback (most recent call last):
File "main.py", line 261, in
trainer.save_mesh(resolution=opt.mcubes_reso, decimate_target=opt.decimate_target, dataset=train_loader._data if opt.mesh_visibility_culling else None)
File "/root/nerf2mesh/nerf/utils.py", line 900, in save_mesh
self.model.export_stage0(save_path, resolution=resolution, decimate_target=decimate_target, dataset=dataset)
File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/root/nerf2mesh/nerf/renderer.py", line 509, in export_stage0
visibility_mask = self.mark_unseen_triangles(vertices, triangles, dataset.mvps, dataset.H, dataset.W).cpu().numpy()
File "/root/miniconda3/lib/python3.8/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/root/nerf2mesh/nerf/renderer.py", line 886, in mark_unseen_triangles
rast, _ = dr.rasterize(self.glctx, vertices_clip, triangles, (H, W)) # [1, H, W, 4]
File "/root/miniconda3/lib/python3.8/site-packages/nvdiffrast/torch/ops.py", line 310, in rasterize
return _rasterize_func.apply(glctx, pos, tri, resolution, ranges, grad_db, -1)
File "/root/miniconda3/lib/python3.8/site-packages/torch/autograd/function.py", line 506, in apply
return super().apply(*args, **kwargs) # type: ignore[misc]
File "/root/miniconda3/lib/python3.8/site-packages/nvdiffrast/torch/ops.py", line 248, in forward
out, out_db = _get_plugin().rasterize_fwd_cuda(raster_ctx.cpp_wrapper, pos, tri, resolution, ranges, peeling_idx)
RuntimeError: instance mode - pos must have shape [>0, >0, 4]
‘’‘’

@ashawkey
Copy link
Owner

@SunyuKy Hi, this indicates some outer cascade is totally empty, if you reduce scale, you may also consider reducing bound so it is not overly large and captures nothing.

@SunyuKy
Copy link
Author

SunyuKy commented May 25, 2023

Thank you very much for your reply. After my test, it seems that the mesh can be output normally only when the scale is -1, and an error will be reported when the scale is other values. What version of pymcubes are you using? I'm wondering if it's a package version issue

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

2 participants