zju3dv / NeuralRecon

Code for "NeuralRecon: Real-Time Coherent 3D Reconstruction from Monocular Video", CVPR 2021 oral
https://zju3dv.github.io/neuralrecon/
Apache License 2.0
2.07k stars 302 forks source link

generate_gt.py got cuda not detected error #133

Closed bloodhunt3r closed 1 year ago

bloodhunt3r commented 1 year ago

when I run the generate_gt.py script from bash, there is an error prompt:


(process_with_single_worker pid=2193423) scene0000_01: read frame 300/5920 [repeated 2x across cluster]
(process_with_single_worker pid=2193424) depth_im: /media/ran/Data/Datasets/ScanNet/scans/scene0001_01/depth/325.png [repeated 361x across cluster]
(process_with_single_worker pid=2193914) scene0004_00: read frame 300/929 [repeated 6x across cluster]
(process_with_single_worker pid=2193423) depth_im: /media/ran/Data/Datasets/ScanNet/scans/scene0000_01/depth/323.png [repeated 206x across cluster]
(process_with_single_worker pid=2194162) scene0009_02: read frame 300/1103 [repeated 3x across cluster]
(process_with_single_worker pid=2194522) depth_im: /media/ran/Data/Datasets/ScanNet/scans/scene0011_00/depth/309.png [repeated 208x across cluster]
(process_with_single_worker pid=2193429) depth_im: /media/ran/Data/Datasets/ScanNet/scans/scene0000_02/depth/282.png [repeated 113x across cluster]
(process_with_single_worker pid=2194277) 
(process_with_single_worker pid=2194675) Initializing voxel volume...
Traceback (most recent call last):
  File "tools/tsdf_fusion/generate_gt.py", line 281, in <module>
    results = ray.get(ray_worker_ids)
  File "/home/ran/miniconda3/envs/neucon/lib/python3.7/site-packages/ray/_private/client_mode_hook.py", line 105, in wrapper
    return func(*args, **kwargs)
  File "/home/ran/miniconda3/envs/neucon/lib/python3.7/site-packages/ray/_private/worker.py", line 2521, in get
    raise value.as_instanceof_cause()
ray.exceptions.RayTaskError(RuntimeError): ray::process_with_single_worker() (pid=2194675, ip=192.168.31.246)
  File "tools/tsdf_fusion/generate_gt.py", line 226, in process_with_single_worker
    save_tsdf_full(args, scene, cam_intr, depth_all, cam_pose_all, color_all, save_mesh=False)
  File "tools/tsdf_fusion/generate_gt.py", line 79, in save_tsdf_full
    tsdf_vol_list.append(TSDFVolume(vol_bnds, voxel_size=args.voxel_size * 2 ** l, margin=args.margin))
  File "/home/ran/PycharmProjects/NeuralRecon/tools/tsdf_fusion/fusion.py", line 24, in __init__
    import pycuda.autoinit
  File "/home/ran/miniconda3/envs/neucon/lib/python3.7/site-packages/pycuda/autoinit.py", line 5, in <module>
    cuda.init()
pycuda._driver.RuntimeError: cuInit failed: no CUDA-capable device is detected

But when I run with command:

python -c "import pycuda.autoinit"

it works normally.

bloodhunt3r commented 1 year ago

solved the issue, I fogot to set the --n_gpu 1 flag to the script, this default parameter is 2, while I only got one, that's why I have this issue.