Skip to content

深度估计时,4090显卡爆显存 #36

@Andyxhw

Description

@Andyxhw

~/xhw/StereoCrafter$ python depth_splatting_inference.py --pre_trained_path ./weights/stable-video-diffusion-img2vid-xt-1-1 --unet_path ./weights/DepthCrafter --input_video_path ./source_video/zuqiu.mp4 --output_video_path ./outputs/zuqiu_splatting_results.mp4
/home/migu/anaconda3/envs/2to3/lib/python3.8/site-packages/Forward_Warp-0.0.1-py3.8.egg/Forward_Warp/forward_warp.py:19: SyntaxWarning: "is" with a literal. Did you mean "=="?
/home/migu/anaconda3/envs/2to3/lib/python3.8/site-packages/Forward_Warp-0.0.1-py3.8.egg/Forward_Warp/forward_warp.py:57: SyntaxWarning: "is" with a literal. Did you mean "=="?
/home/migu/anaconda3/envs/2to3/lib/python3.8/site-packages/Forward_Warp-0.0.1-py3.8.egg/Forward_Warp/forward_warp.py:58: SyntaxWarning: "is" with a literal. Did you mean "=="?
/home/migu/anaconda3/envs/2to3/lib/python3.8/site-packages/Forward_Warp-0.0.1-py3.8.egg/Forward_Warp/forward_warp.py:19: SyntaxWarning: "is" with a literal. Did you mean "=="?
/home/migu/anaconda3/envs/2to3/lib/python3.8/site-packages/Forward_Warp-0.0.1-py3.8.egg/Forward_Warp/forward_warp.py:57: SyntaxWarning: "is" with a literal. Did you mean "=="?
/home/migu/anaconda3/envs/2to3/lib/python3.8/site-packages/Forward_Warp-0.0.1-py3.8.egg/Forward_Warp/forward_warp.py:58: SyntaxWarning: "is" with a literal. Did you mean "=="?
Loading pipeline components...: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:00<00:00, 28.03it/s]
==> processing video: ./source_video/zuqiu.mp4
==> original video shape: (9577, 1080, 1920, 3)
==> downsampled shape: (9577, 576, 1024, 3), with stride: 1
==> final processing shape: (9577, 576, 1024, 3)
Traceback (most recent call last):
File "depth_splatting_inference.py", line 305, in
Fire(main)
File "/home/migu/anaconda3/envs/2to3/lib/python3.8/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "/home/migu/anaconda3/envs/2to3/lib/python3.8/site-packages/fire/core.py", line 475, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "/home/migu/anaconda3/envs/2to3/lib/python3.8/site-packages/fire/core.py", line 691, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "depth_splatting_inference.py", line 287, in main
video_depth, depth_vis = depthcrafter_demo.infer(
File "depth_splatting_inference.py", line 123, in infer
res = self.pipe(
File "/home/migu/anaconda3/envs/2to3/lib/python3.8/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/home/migu/xhw/StereoCrafter/dependency/DepthCrafter/depthcrafter/depth_crafter_ppl.py", line 152, in call
video = video.to(device=device, dtype=self.dtype)
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 31.57 GiB (GPU 0; 23.53 GiB total capacity; 0 bytes already allocated; 23.07 GiB free; 0 bytes reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

申请31.57G显存,4090只有24G.请问如何缩小申请的内存?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions