Giter Site home page Giter Site logo

Build errors, Windows about nerf2mesh HOT 16 OPEN

ashawkey avatar ashawkey commented on May 23, 2024
Build errors, Windows

from nerf2mesh.

Comments (16)

antithing avatar antithing commented on May 23, 2024

Ah, i have solved this based on this comment:

ashawkey/stable-dreamfusion#17 (comment)

and have made these changes: (removing const from the at:Tensor variables

-void composite_rays(const uint32_t n_alive, const uint32_t n_step, const float T_thresh, at::Tensor rays_alive, at::Tensor rays_t, const at::Tensor sigmas, const at::Tensor rgbs, const at::Tensor deltas, at::Tensor weights, at::Tensor depth, at::Tensor image) {

+void composite_rays(const uint32_t n_alive, const uint32_t n_step, const float T_thresh, at::Tensor rays_alive, at::Tensor rays_t, at::Tensor sigmas, at::Tensor rgbs, at::Tensor deltas, at::Tensor weights, at::Tensor depth, at::Tensor image) {

from nerf2mesh.

ashawkey avatar ashawkey commented on May 23, 2024

@antithing Thanks for reporting and sorry for that, I'll fix it soon.

from nerf2mesh.

antithing avatar antithing commented on May 23, 2024

Thanks! One more thing to report...

i have run the first stage successfully, now i am running:

python main.py data/garden/ --workspace trial_360_garden -O --data_format colmap --bound 16 --enable_cam_center --enable_cam_near_far --scale 0.3 --downscale 4 --stage 1 --iters 10000

And i get the following error:

0% 0/161 [00:00<?, ?it/s]Traceback (most recent call last):
 File "D:\NERF\SDF\nerf2mesh\main.py", line 243, in <module>
   trainer.train(train_loader, valid_loader, max_epoch)
 File "D:\NERF\SDF\nerf2mesh\nerf\utils.py", line 931, in train
   self.train_one_epoch(train_loader)
 File "D:\NERF\SDF\nerf2mesh\nerf\utils.py", line 1164, in train_one_epoch
   preds, truths, loss_net = self.train_step(data)
 File "D:\NERF\SDF\nerf2mesh\nerf\utils.py", line 720, in train_step
   self.model.update_triangles_errors(loss.detach())
 File "C:\Users\B\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
   return func(*args, **kwargs)
 File "D:\NERF\SDF\nerf2mesh\nerf\renderer.py", line 854, in update_triangles_errors
   import torch_scatter
 File "C:\Users\B\AppData\Local\Programs\Python\Python39\lib\site-packages\torch_scatter\__init__.py", line 16, in <module>
   torch.ops.load_library(spec.origin)
 File "C:\Users\B\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\_ops.py", line 255, in load_library
   ctypes.CDLL(path)
 File "C:\Users\B\AppData\Local\Programs\Python\Python39\lib\ctypes\__init__.py", line 374, in __init__
   self._handle = _dlopen(self._name, mode)
OSError: [WinError 127] The specified procedure could not be found
 0% 0/161 [00:25<?, ?it/s]

from nerf2mesh.

ashawkey avatar ashawkey commented on May 23, 2024

Have you installed torch-scatter correctly? You could check here for Windows binaries or build it from source.

from nerf2mesh.

antithing avatar antithing commented on May 23, 2024

Ah, you are right. This was because I had scatter installed for a different CUDA version than torch. Resolved! Thanks again. :)

from nerf2mesh.

antithing avatar antithing commented on May 23, 2024

Ah, but I get another error! training starts, then:

 refine and decimate mesh at 1000 step
Traceback (most recent call last):
  File "D:\NERF\SDF\nerf2mesh\main.py", line 243, in <module>
    trainer.train(train_loader, valid_loader, max_epoch)
  File "D:\NERF\SDF\nerf2mesh\nerf\utils.py", line 931, in train
    self.train_one_epoch(train_loader)
  File "D:\NERF\SDF\nerf2mesh\nerf\utils.py", line 1206, in train_one_epoch
    self.model.refine_and_decimate()
  File "C:\Users\B\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "D:\NERF\SDF\nerf2mesh\nerf\renderer.py", line 219, in refine_and_decimate
    mask[(errors > thresh_refine) & cnt_mask] = 2
IndexError: boolean index did not match indexed array along dimension 0; dimension is 870831 but corresponding boolean dimension is 299999
loss=0.006328 (0.006733) lr=0.000089: :  21% 34/161 [00:05<00:21,  5.97it/s]

from nerf2mesh.

antithing avatar antithing commented on May 23, 2024

I try the same with --sdf and i see:


 refine and decimate mesh at 1000 step
Traceback (most recent call last):
  File "D:\NERF\SDF\nerf2mesh\main.py", line 243, in <module>
    trainer.train(train_loader, valid_loader, max_epoch)
  File "D:\NERF\SDF\nerf2mesh\nerf\utils.py", line 931, in train
    self.train_one_epoch(train_loader)
  File "D:\NERF\SDF\nerf2mesh\nerf\utils.py", line 1206, in train_one_epoch
    self.model.refine_and_decimate()
  File "C:\Users\B\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "D:\NERF\SDF\nerf2mesh\nerf\renderer.py", line 251, in refine_and_decimate
    cur_v, cur_f = decimate_and_refine_mesh(cur_v, cur_f, mask, decimate_ratio=self.opt.refine_decimate_ratio, refine_size=self.opt.refine_size, refine_remesh_size=self.opt.refine_remesh_size)
  File "D:\NERF\SDF\nerf2mesh\meshutils.py", line 199, in decimate_and_refine_mesh
    m = pml.Mesh(verts, faces, f_scalar_array=mask)
pymeshlab.pmeshlab.PyMeshLabException: Error while creating mesh: the number of face quality values is different from the number of faces.

from nerf2mesh.

antithing avatar antithing commented on May 23, 2024

Hi @ashawkey sorry to bother you, do you have any thoughts on what might be going wrong for me here? Thanks again!

from nerf2mesh.

ashawkey avatar ashawkey commented on May 23, 2024

Both seem strange to me, and they seem to indicate something wrong with the extracted mesh. Could you check the mesh from stage0? Are you using a custom dataset?

from nerf2mesh.

antithing avatar antithing commented on May 23, 2024

I am using the mipnerf360/garden dataset. I am running:

python main.py data/garden/ --workspace trial_360_garden -O --data_format colmap --bound 16 --enable_cam_center --enable_cam_near_far --scale 0.3 --downscale 4 --stage 0 --lambda_entropy 1e-3 --clean_min_f 16 --clean_min_d 10 --lambda_tv 2e-8 --visibility_mask_dilation 50

for stage 0, and then:

python main.py data/garden/ --workspace trial_360_garden -O --data_format colmap --bound 16 --enable_cam_center --enable_cam_near_far --scale 0.3 --downscale 4 --stage 1 --iters 10000

for stage 1

the dtage 0 mesh output folder looks like:

image

And the mesh_0.ply looks like:

image

from nerf2mesh.

ashawkey avatar ashawkey commented on May 23, 2024

Sorry it's my mistake, I have fixed it in the latest commit. Thanks for reporting this bug!

from nerf2mesh.

antithing avatar antithing commented on May 23, 2024

Thank you! It works :)

One more question, what settings should I change to get a smoother output mesh? I am using the example commands, and i get:

image

Thank you again!

from nerf2mesh.

ashawkey avatar ashawkey commented on May 23, 2024

You may use --sdf if aiming at smooth mesh, but currently it only supports object-centric captures, and not suitable for 360 dataset (you need to remove the background for best mesh quality).

from nerf2mesh.

aKn1ghtOut avatar aKn1ghtOut commented on May 23, 2024

I try the same with --sdf and i see:


 refine and decimate mesh at 1000 step
Traceback (most recent call last):
  File "D:\NERF\SDF\nerf2mesh\main.py", line 243, in <module>
    trainer.train(train_loader, valid_loader, max_epoch)
  File "D:\NERF\SDF\nerf2mesh\nerf\utils.py", line 931, in train
    self.train_one_epoch(train_loader)
  File "D:\NERF\SDF\nerf2mesh\nerf\utils.py", line 1206, in train_one_epoch
    self.model.refine_and_decimate()
  File "C:\Users\B\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\autograd\grad_mode.py", line 27, in decorate_context
    return func(*args, **kwargs)
  File "D:\NERF\SDF\nerf2mesh\nerf\renderer.py", line 251, in refine_and_decimate
    cur_v, cur_f = decimate_and_refine_mesh(cur_v, cur_f, mask, decimate_ratio=self.opt.refine_decimate_ratio, refine_size=self.opt.refine_size, refine_remesh_size=self.opt.refine_remesh_size)
  File "D:\NERF\SDF\nerf2mesh\meshutils.py", line 199, in decimate_and_refine_mesh
    m = pml.Mesh(verts, faces, f_scalar_array=mask)
pymeshlab.pmeshlab.PyMeshLabException: Error while creating mesh: the number of face quality values is different from the number of faces.

Hi, I am receiving the same error when using SDF with the latest commit. BTW, amazing project. I'm looking into the details right now, hoping to contribute as well. @ashawkey 🚀🚀

from nerf2mesh.

ashawkey avatar ashawkey commented on May 23, 2024

Hi, SDF mode is currently only suitable for single-object datasets with bound == 1. For the garden dataset, you could try the original NeRF mode.

from nerf2mesh.

r530044129 avatar r530044129 commented on May 23, 2024

after pull the lastest version, I still meet the same problem when I run 'python setup.py build_ext --inplace'

build\lib.win-amd64-cpython-39_raymarching_mob.cp39-win_amd64.pyd : fatal error LNK1120: 3 个无法解析的外部命令
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\link.exe' failed with exit code 1120

from nerf2mesh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.