Stability-AI / stable-fast-3d

SF3D: Stable Fast 3D Mesh Reconstruction with UV-unwrapping and Illumination Disentanglement
https://stable-fast-3d.github.io
Other
1.2k stars 131 forks source link

Failed to run example. #46

Open SaranWraps opened 2 months ago

SaranWraps commented 2 months ago

Can't seem to be able to run the example:

(fast3d) ➜  stable-fast-3d git:(main) python run.py demo_files/examples/chair1.png --output-dir output/
Device used:  cuda
/home/xavier/Documents/f3d/stable-fast-3d/sf3d/models/network.py:22: FutureWarning: `torch.cuda.amp.custom_fwd(args...)` is deprecated. Please use `torch.amp.custom_fwd(args..., device_type='cuda')` instead.
  return decorator_with_args(*args, **kwargs)(fn)
/home/xavier/miniconda3/envs/fast3d/lib/python3.10/site-packages/open_clip/factory.py:128: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  checkpoint = torch.load(checkpoint_path, map_location=map_location)
  0%|                                                                                                                                                                                                                                                                                                                           | 0/1 [00:00<?, ?it/s]After Remesh 9880 19760
  0%|                                                                                                                                                                                                                                                                                                                           | 0/1 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "/home/xavier/Documents/f3d/stable-fast-3d/run.py", line 122, in <module>
    mesh, glob_dict = model.run_image(
  File "/home/xavier/Documents/f3d/stable-fast-3d/sf3d/system.py", line 287, in run_image
    meshes, global_dict = self.generate_mesh(
  File "/home/xavier/Documents/f3d/stable-fast-3d/sf3d/system.py", line 370, in generate_mesh
    rast = self.baker.rasterize(
  File "/home/xavier/miniconda3/envs/fast3d/lib/python3.10/site-packages/texture_baker/baker.py", line 28, in rasterize
    return torch.ops.texture_baker_cpp.rasterize(
  File "/home/xavier/miniconda3/envs/fast3d/lib/python3.10/site-packages/torch/_ops.py", line 1061, in __call__
    return self_._op(*args, **(kwargs or {}))
NotImplementedError: Could not run 'texture_baker_cpp::rasterize' with arguments from the 'CUDA' backend. This could be because the operator doesn't exist for this backend, or was omitted during the selective/custom build process (if using custom build). If you are a Facebook employee using PyTorch on mobile, please visit https://fburl.com/ptmfixes for possible resolutions. 'texture_baker_cpp::rasterize' is only available for these backends: [CPU, Meta, BackendSelect, Python, FuncTorchDynamicLayerBackMode, Functionalize, Named, Conjugate, Negative, ZeroTensor, ADInplaceOrView, AutogradOther, AutogradCPU, AutogradCUDA, AutogradXLA, AutogradMPS, AutogradXPU, AutogradHPU, AutogradLazy, AutogradMeta, Tracer, AutocastCPU, AutocastXPU, AutocastCUDA, FuncTorchBatched, BatchedNestedTensor, FuncTorchVmapMode, Batched, VmapMode, FuncTorchGradWrapper, PythonTLSSnapshot, FuncTorchDynamicLayerFrontMode, PreDispatch, PythonDispatcher].

OS: Ubuntu 24.04 LTS Cpu: Ryzen 1700 Gpu: RTX 3090

jammm commented 2 months ago

Can you try some of the suggestions mentioned in https://github.com/Stability-AI/stable-fast-3d/issues/39 ?

It's possible that running the pip install ./uv_unwrapper from within conda environment doesn't detect CUDA. We haven't tried with conda though, so I'm not sure. Regardless, can you try setting the USE_CUDA=1 env var and trying again?