19reborn / NeuS2

[ICCV 2023] Official code for NeuS2
Other
641 stars 42 forks source link

IndexError: max(): Expected reduction dim 1 to have non-zero size. #72

Open amughrabi opened 7 months ago

amughrabi commented 7 months ago

After running the code, I encountered the following issue for several scenes.

Code:

python3 -u scripts/run.py --scene "$DATASET_PATH"/transforms.json --name "$DATASET_NAME" --network dtu.json --n_steps 15000 --save_mesh --save_mesh_path "$DATASET_PATH"/mesh.ply

Output:

Saving snapshot  output/dish_1568315001/checkpoints/15000.msgpack loss=nan]  
Generating mesh via marching cubes and saving to output/dish_1568315001/mesh/15000.obj. Resolution=[512,512,512]
unwrap_it:0
13:26:11 INFO     #vertices=0 #triangles=0
Training: 100%|█████████▉| 14997/15000 [09:04<00:00, 27.53step/s, loss=nan]
Traceback (most recent call last):5000 [07:11<01:59, 26.86step/s, loss=nan]
  File "scripts/run.py", line 248, in <module>
    render_img_training_view(args, testbed, log_ptr, args.scene)
  File "/home/projects/NeuS2/scripts/render_utils.py", line 419, in render_img_training_view
    normal_img = render_mesh(renderer, vex.astype(np.float32), faces, ixt, ext, shaded = args.shaded_mesh)
  File "/home/projects/NeuS2/scripts/pytorch3d_utils.py", line 1062, in render_mesh
    renderer.load_mesh(verts=vertices,faces=faces,verts_rgb=normals*0.5+0.5)
  File "/home/projects/NeuS2/scripts/pytorch3d_utils.py", line 680, in load_mesh
    (verts.max(dim=1)[0][0, 1] + verts.min(dim=1)[0][0, 1])).item()
IndexError: max(): Expected reduction dim 1 to have non-zero size.