ashawkey / stable-dreamfusion

Text-to-3D & Image-to-3D & Mesh Exportation with NeRF + Diffusion.
Apache License 2.0
7.99k stars 710 forks source link

IndexError: list index out of range #322

Open admiralamott1 opened 1 year ago

admiralamott1 commented 1 year ago

Description

Used this: python main.py --text "a hamburger" --workspace trial -O

And got this: `No CUDA runtime is found, using CUDA_HOME='C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.2' Warning: Unable to load the following plugins:

    filter_func.dll: filter_func.dll does not seem to be a Qt Plugin.

Cannot load library C:\Users\Holly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pymeshlab\lib\plugins\filter_func.dll: The specified module could not be found. filter_mesh_booleans.dll: filter_mesh_booleans.dll does not seem to be a Qt Plugin.

Cannot load library C:\Users\Holly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pymeshlab\lib\plugins\filter_mesh_booleans.dll: The specified module could not be found. filter_sketchfab.dll: filter_sketchfab.dll does not seem to be a Qt Plugin.

Cannot load library C:\Users\Holly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pymeshlab\lib\plugins\filter_sketchfab.dll: The specified module could not be found. io_3ds.dll: io_3ds.dll does not seem to be a Qt Plugin.

Cannot load library C:\Users\Holly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pymeshlab\lib\plugins\io_3ds.dll: The specified module could not be found. io_e57.dll: io_e57.dll does not seem to be a Qt Plugin.

Cannot load library C:\Users\Holly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pymeshlab\lib\plugins\io_e57.dll: The specified module could not be found. io_u3d.dll: io_u3d.dll does not seem to be a Qt Plugin.

Cannot load library C:\Users\Holly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\pymeshlab\lib\plugins\io_u3d.dll: The specified module could not be found.

Namespace(file=None, text='a hamburger', negative='', O=True, O2=False, test=False, six_views=False, eval_interval=1, test_interval=100, workspace='trial', seed=None, image=None, image_config=None, known_view_interval=4, IF=False, guidance=['SD'], guidance_scale=100, save_mesh=False, mcubes_resolution=256, decimate_target=50000.0, dmtet=False, tet_grid_size=128, init_with='', lock_geo=False, perpneg=False, negative_w=-2, front_decay_factor=2, side_decay_factor=10, iters=10000, lr=0.001, ckpt='latest', cuda_ray=True, taichi_ray=False, max_steps=1024, num_steps=64, upsample_steps=32, update_extra_interval=16, max_ray_batch=4096, latent_iter_ratio=0.2, albedo_iter_ratio=0, min_ambient_ratio=0.1, textureless_ratio=0.2, jitter_pose=False, jitter_center=0.2, jitter_target=0.2, jitter_up=0.02, uniform_sphere_rate=0, grad_clip=-1, grad_clip_rgb=-1, bg_radius=1.4, density_activation='exp', density_thresh=10, blob_density=5, blob_radius=0.2, backbone='grid', optim='adan', sd_version='2.1', hf_key=None, fp16=True, vram_O=False, w=64, h=64, known_view_scale=1.5, known_view_noise_scale=0.002, dmtet_reso_scale=8, batch_size=1, bound=1, dt_gamma=0, min_near=0.01, radius_range=[3.0, 3.5], theta_range=[45, 105], phi_range=[-180, 180], fovy_range=[10, 30], default_radius=3.2, default_polar=90, default_azimuth=0, default_fovy=20, progressive_view=False, progressive_view_init_ratio=0.2, progressive_level=False, angle_overhead=30, angle_front=60, t_range=[0.02, 0.98], dont_override_stuff=False, lambda_entropy=0.001, lambda_opacity=0, lambda_orient=0.01, lambda_tv=0, lambda_wd=0, lambda_mesh_normal=0.5, lambda_mesh_laplacian=0.5, lambda_guidance=1, lambda_rgb=1000, lambda_mask=500, lambda_normal=0, lambda_depth=10, lambda_2d_normal_smooth=0, lambda_3d_normal_smooth=0, save_guidance=False, save_guidance_interval=10, gui=False, W=800, H=800, radius=5, fovy=20, light_theta=60, light_phi=0, max_spp=1, zero123_config='./pretrained/zero123/sd-objaverse-finetune-c_concat-256.yaml', zero123_ckpt='./pretrained/zero123/105000.ckpt', zero123_grad_scale='angle', dataset_size_train=100, dataset_size_valid=8, dataset_size_test=100, exp_start_iter=0, exp_end_iter=10000, images=None, ref_radii=[], ref_polars=[], ref_azimuths=[], zero123_ws=[], default_zero123_w=1) ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ C:\Users\Holly\Desktop\pifuhd-main\f\stable-dreamfusion\gridencoder\grid.py:11 in │ │ │ │ 8 from torch.cuda.amp import custom_bwd, custom_fwd │ │ 9 │ │ 10 try: │ │ ❱ 11 │ import _gridencoder as _backend │ │ 12 except ImportError: │ │ 13 │ from .backend import _backend │ │ 14 │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ModuleNotFoundError: No module named '_gridencoder'

During handling of the above exception, another exception occurred:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ C:\Users\Holly\Desktop\pifuhd-main\f\stable-dreamfusion\main.py:315 in │ │ │ │ 312 │ │ │ 313 │ device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') │ │ 314 │ │ │ ❱ 315 │ model = NeRFNetwork(opt).to(device) │ │ 316 │ │ │ 317 │ if opt.dmtet and opt.init_with != '': │ │ 318 │ │ if opt.init_with.endswith('.pth'): │ │ │ │ C:\Users\Holly\Desktop\pifuhd-main\f\stable-dreamfusion\nerf\network_grid.py:49 in init │ │ │ │ 46 │ │ self.num_layers = num_layers │ │ 47 │ │ self.hidden_dim = hidden_dim │ │ 48 │ │ │ │ ❱ 49 │ │ self.encoder, self.in_dim = get_encoder('hashgrid', input_dim=3, log2_hashmap_si │ │ 50 │ │ │ │ 51 │ │ self.sigma_net = MLP(self.in_dim, 4, hidden_dim, num_layers, bias=True) │ │ 52 │ │ # self.normal_net = MLP(self.in_dim, 3, hidden_dim, num_layers, bias=True) │ │ │ │ C:\Users\Holly\Desktop\pifuhd-main\f\stable-dreamfusion\encoding.py:75 in get_encoder │ │ │ │ 72 │ │ encoder = SHEncoder(input_dim=input_dim, degree=degree) │ │ 73 │ │ │ 74 │ elif encoding == 'hashgrid': │ │ ❱ 75 │ │ from gridencoder import GridEncoder │ │ 76 │ │ encoder = GridEncoder(input_dim=input_dim, num_levels=num_levels, level_dim=leve │ │ 77 │ │ │ 78 │ elif encoding == 'tiledgrid': │ │ │ │ C:\Users\Holly\Desktop\pifuhd-main\f\stable-dreamfusion\gridencoder__init__.py:1 in │ │ │ │ ❱ 1 from .grid import GridEncoder │ │ 2 │ │ │ │ C:\Users\Holly\Desktop\pifuhd-main\f\stable-dreamfusion\gridencoder\grid.py:13 in │ │ │ │ 10 try: │ │ 11 │ import _gridencoder as _backend │ │ 12 except ImportError: │ │ ❱ 13 │ from .backend import _backend │ │ 14 │ │ 15 _gridtype_to_id = { │ │ 16 │ 'hash': 0, │ │ │ │ C:\Users\Holly\Desktop\pifuhd-main\f\stable-dreamfusion\gridencoder\backend.py:31 in │ │ │ │ 28 │ │ │ raise RuntimeError("Could not locate a supported Microsoft Visual C++ instal │ │ 29 │ │ os.environ["PATH"] += ";" + cl_path │ │ 30 │ │ ❱ 31 _backend = load(name='_grid_encoder', │ │ 32 │ │ │ │ extra_cflags=c_flags, │ │ 33 │ │ │ │ extra_cuda_cflags=nvcc_flags, │ │ 34 │ │ │ │ sources=[os.path.join(_src_path, 'src', f) for f in [ │ │ │ │ C:\Users\Holly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCac │ │ he\local-packages\Python39\site-packages\torch\utils\cpp_extension.py:1284 in load │ │ │ │ 1281 │ │ ... extra_cflags=['-O2'], │ │ 1282 │ │ ... verbose=True) │ │ 1283 │ ''' │ │ ❱ 1284 │ return _jit_compile( │ │ 1285 │ │ name, │ │ 1286 │ │ [sources] if isinstance(sources, str) else sources, │ │ 1287 │ │ extra_cflags, │ │ │ │ C:\Users\Holly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCac │ │ he\local-packages\Python39\site-packages\torch\utils\cpp_extension.py:1509 in _jit_compile │ │ │ │ 1506 │ │ │ │ │ │ │ │ 1507 │ │ │ │ │ │ sources = list(hipified_sources) │ │ 1508 │ │ │ │ │ │ │ ❱ 1509 │ │ │ │ │ _write_ninja_file_and_build_library( │ │ 1510 │ │ │ │ │ │ name=name, │ │ 1511 │ │ │ │ │ │ sources=sources, │ │ 1512 │ │ │ │ │ │ extra_cflags=extra_cflags or [], │ │ │ │ C:\Users\Holly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCac │ │ he\local-packages\Python39\site-packages\torch\utils\cpp_extension.py:1611 in │ │ _write_ninja_file_and_build_library │ │ │ │ 1608 │ │ print(f'Emitting ninja build file {build_file_path}...', file=sys.stderr) │ │ 1609 │ # NOTE: Emitting a new ninja build file does not cause re-compilation if │ │ 1610 │ # the sources did not change, so it's ok to re-emit (and it's fast). │ │ ❱ 1611 │ _write_ninja_file_to_build_library( │ │ 1612 │ │ path=build_file_path, │ │ 1613 │ │ name=name, │ │ 1614 │ │ sources=sources, │ │ │ │ C:\Users\Holly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCac │ │ he\local-packages\Python39\site-packages\torch\utils\cpp_extension.py:2007 in │ │ _write_ninja_file_to_build_library │ │ │ │ 2004 │ │ cuda_flags += extra_cuda_cflags │ │ 2005 │ │ cuda_flags += _get_rocm_arch_flags(cuda_flags) │ │ 2006 │ elif with_cuda: │ │ ❱ 2007 │ │ cuda_flags = common_cflags + COMMON_NVCC_FLAGS + _get_cuda_arch_flags() │ │ 2008 │ │ if IS_WINDOWS: │ │ 2009 │ │ │ for flag in COMMON_MSVC_FLAGS: │ │ 2010 │ │ │ │ cuda_flags = ['-Xcompiler', flag] + cuda_flags │ │ │ │ C:\Users\Holly\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCac │ │ he\local-packages\Python39\site-packages\torch\utils\cpp_extension.py:1773 in │ │ _get_cuda_arch_flags │ │ │ │ 1770 │ │ │ if arch not in arch_list: │ │ 1771 │ │ │ │ arch_list.append(arch) │ │ 1772 │ │ arch_list = sorted(arch_list) │ │ ❱ 1773 │ │ arch_list[-1] += '+PTX' │ │ 1774 │ else: │ │ 1775 │ │ # Deal with lists that are ' ' separated (only deal with ';' after) │ │ 1776 │ │ _arch_list = _arch_list.replace(' ', ';') │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ IndexError: list index out of range `

Steps to Reproduce

Type in Used this: python main.py --text "a hamburger" --workspace trial -O

Expected Behavior

It works

Environment

cuda 12.2.0