pierotofy / OpenSplat

Production-grade 3D gaussian splatting with CPU/GPU support for Windows, Mac and Linux 🚀
https://antimatter15.com/splat/?url=https://splat.uav4geo.com/banana.splat
GNU Affero General Public License v3.0
812 stars 74 forks source link

element 0 of tensors does not require grad and does not have a grad_fn #66

Open vasilistriantafyllou opened 5 months ago

vasilistriantafyllou commented 5 months ago

it runs fine on the example datasets, i aligned with metashape, converted to nerfstudio with ns-process-data and exported a pointcloud/tiepoints in local coordinate system(i also tried mercator(epsg:3395) ply export) and added "ply_file_path": "spc.ply" to the json

windows 11 cuda 11.8 OpenSplat v1.1.2 Visual Studio 2022 libtorch 2.2.2 because recommended libtorch 2.1.2 didn't want to compile cmake 3.28.3 opencv 4.9.0 dual gpu sli 2080 ti all images were 4000x3000

build log:

-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22631.
-- The C compiler identification is MSVC 19.31.31104.0
-- The CXX compiler identification is MSVC 19.31.31104.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found CUDAToolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include (found version "11.8.89")
-- The CUDA compiler identification is NVIDIA 11.8.89
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/bin/nvcc.exe - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Found CUDA: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8 (found version "11.8")
-- Found CUDAToolkit: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/include (found version "11.8.89")
-- Caffe2: CUDA detected: 11.8
-- Caffe2: CUDA nvcc is: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/bin/nvcc.exe
-- Caffe2: CUDA toolkit directory: C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8
-- Caffe2: Header version is: 11.8
-- C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.8/lib/x64/nvrtc.lib shorthash is dd482e34
-- USE_CUDNN is set to 0. Compiling without cuDNN support
-- USE_CUSPARSELT is set to 0. Compiling without cuSPARSELt support
-- Autodetected CUDA architecture(s):  7.5 7.5
-- Added CUDA NVCC flags for: -gencode;arch=compute_75,code=sm_75
-- Found Torch: E:/Git/OpenSplat/libtorch/lib/torch.lib
-- OpenCV ARCH: x64
-- OpenCV RUNTIME: vc16
-- OpenCV STATIC: OFF
-- Found OpenCV: E:/Git/OpenSplat/opencv/build (found version "4.9.0")
-- Found OpenCV 4.9.0 in E:/Git/OpenSplat/opencv/build/x64/vc16/lib
-- You might need to add E:\Git\OpenSplat\opencv\build\x64\vc16\bin to your PATH to be able to run your applications.
-- Configuring done (19.7s)
-- Generating done (0.1s)
-- Build files have been written to: E:/Git/OpenSplat/build

cmake --build . --config Release went fine, there were plenty of type conversion warnings but nothing else

here's my run:


Using CUDA
Reading 29939 points
Loading nsproj\images/frame_00001.jpg
Loading nsproj\images/frame_00002.jpg
Loading nsproj\images/frame_00003.jpg
Loading nsproj\images/frame_00004.jpg
Loading nsproj\images/frame_00005.jpg
Loading nsproj\images/frame_00006.jpg
Loading nsproj\images/frame_00007.jpg
Loading nsproj\images/frame_00008.jpg
Loading nsproj\images/frame_00009.jpg
Loading nsproj\images/frame_00010.jpg
Loading nsproj\images/frame_00011.jpg
Loading nsproj\images/frame_00012.jpg
Loading nsproj\images/frame_00013.jpg
Loading nsproj\images/frame_00014.jpg
Loading nsproj\images/frame_00015.jpg
Loading nsproj\images/frame_00016.jpg
Loading nsproj\images/frame_00017.jpg
Loading nsproj\images/frame_00018.jpg
Loading nsproj\images/frame_00019.jpg
Loading nsproj\images/frame_00020.jpg
Loading nsproj\images/frame_00021.jpg
Loading nsproj\images/frame_00022.jpg
Loading nsproj\images/frame_00023.jpg
Loading nsproj\images/frame_00024.jpg
Loading nsproj\images/frame_00025.jpg
Loading nsproj\images/frame_00026.jpg
Loading nsproj\images/frame_00027.jpg
Loading nsproj\images/frame_00028.jpg
Loading nsproj\images/frame_00029.jpg
Loading nsproj\images/frame_00030.jpg
Loading nsproj\images/frame_00031.jpg
Loading nsproj\images/frame_00032.jpg
Loading nsproj\images/frame_00033.jpg
Loading nsproj\images/frame_00034.jpg
Loading nsproj\images/frame_00035.jpg
Loading nsproj\images/frame_00036.jpg
element 0 of tensors does not require grad and does not have a grad_fn
Exception raised from run_backward at C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\autograd\autograd.cpp:109 (most recent call first):
00007FF98162AF4200007FF98162AEE0 c10.dll!c10::Error::Error [<unknown file> @ <unknown line number>]
00007FF98162AACA00007FF98162AA70 c10.dll!c10::detail::torchCheckFail [<unknown file> @ <unknown line number>]
00007FF8894E13F600007FF8894E1170 torch_cpu.dll!torch::autograd::grad [<unknown file> @ <unknown line number>]
00007FF8894E106A00007FF8894E1000 torch_cpu.dll!torch::autograd::backward [<unknown file> @ <unknown line number>]
00007FF88952014100007FF88951D730 torch_cpu.dll!torch::autograd::SavedVariable::unpack [<unknown file> @ <unknown line number>]
00007FF886B1815400007FF886B18100 torch_cpu.dll!at::Tensor::_backward [<unknown file> @ <unknown line number>]
00007FF886930CB000007FF886930C30 torch_cpu.dll!at::Tensor::backward [<unknown file> @ <unknown line number>]
00007FF716C0FF3100007FF716C0CA60 opensplat.exe!c10::ivalue::Future::waitAndThrow [<unknown file> @ <unknown line number>]
00007FF716C6FEE000007FF716C0CA60 opensplat.exe!c10::ivalue::Future::waitAndThrow [<unknown file> @ <unknown line number>]
00007FF9E1D5257D00007FF9E1D52560 KERNEL32.DLL!BaseThreadInitThunk [<unknown file> @ <unknown line number>]
00007FF9E352AA4800007FF9E352AA20 ntdll.dll!RtlUserThreadStart [<unknown file> @ <unknown line number>]```
pierotofy commented 5 months ago

Possible duplicate of #39

Can you share the dataset?

vasilistriantafyllou commented 5 months ago

thanks for the quick reply, here's my dataset: http://vmi604142.contaboserver.net:1234/d/7166ae5d494446e6b596/

pierotofy commented 5 months ago

It's possible that there's some issue with the export from Metashape, due to ns-process-data? I'm not able to run this dataset with nerfstudio either, in which case it's probably not an issue with OpenSplat.

pfxuan commented 5 months ago

Maybe you can try this and this workarounds.