RollingDepth icon indicating copy to clipboard operation
RollingDepth copied to clipboard

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0!

Open Rand0Pers0n opened this issue 1 year ago • 2 comments

Not sure if its related to "refine_step" or not as fast/1024 are 0 and full is 10, fast/1024 work fine but full always has this error.

If not supported or an issue as I'm running on Windows and not WSL or Linux no problem. I would like to try full or try something custom with "refine_step" but always has this error. Fast fine for the most part I just would like to see what this can really do even if it takes an hour or more.

NFO:root:Saving predictions to .output\fast1024\BBB00001562_pred.npy INFO:root:Using codec: h264 Writing video: 100%|████████████████████████████████████████████████████████████████| 251/251 [00:01<00:00, 187.09it/s] INFO:root:Using codec: h264█████████████████████████████████████████████████████▏ | 236/251 [00:01<00:00, 179.05it/s] Writing video: 100%|█████████████████████████████████████████████████████████████████| 251/251 [00:02<00:00, 87.52it/s] Writing video: 98%|███████████████████████████████████████████████████████████████▍ | 245/251 [00:02<00:00, 89.74it/s]INFO:root:Using codec: h264 Writing video: 100%|████████████████████████████████████████████████████████████████| 251/251 [00:01<00:00, 184.18it/s] Processing videos: 100%|████████████████████████████████████████████████████████████████| 1/1 [03:37<00:00, 217.35s/it] INFO:root:Finished. 1 predictions are saved to .output\fast1024

(.venv) D:_RollingDepth_>python run_video.py -i .input/ -o .output/full -p full --verbose !!!!!!!!!!!!!! [RollingDepth] Using modified Diffusers for cross-frame self-attention !!!!!!!!!!!!!! A matching Triton is not available, some optimizations will not be enabled Traceback (most recent call last): File "D:_RollingDepth_.venv\Lib\site-packages\xformers_init_.py", line 57, in is_triton_available import triton # noqa ^^^^^^^^^^^^^ ModuleNotFoundError: No module named 'triton' INFO:root:Using preset: full INFO:root:arguments: {'res': 1024, 'snippet_lengths': [3], 'cap_dilation': True, 'dtype': 'fp16', 'refine_snippet_len': 3, 'refine_start_dilation': 6, 'dilations': [1, 10, 25], 'refine_step': 10, 'input_video': '.input/', 'output_dir': '.output/full', 'preset': 'full', 'start_frame': 0, 'frame_count': 0, 'checkpoint': 'prs-eth/rollingdepth-v1-0', 'max_vae_bs': 4, 'output_fps': 0, 'restore_res': False, 'save_sbs': True, 'save_npy': True, 'save_snippets': False, 'color_maps': ['Spectral_r', 'Greys_r'], 'resample_method': 'BILINEAR', 'unload_snippet': False, 'verbose': True, 'seed': None} INFO:root:device = cuda INFO:root:Found 1 videos. Loading pipeline components...: 100%|████████████████████████████████████████████████████| 5/5 [00:01<00:00, 4.33it/s] INFO:root:xformers enabled Processing videos: 0%| INFO:root:251 frames loaded from video .input\BBB00001562.mov [00:00<?, ?it/s] Processing videos: 0%| | 0/1 [05:03<?, ?it/s] Traceback (most recent call last): File "D:_RollingDepth\run_video.py", line 491, in pipe_out: RollingDepthOutput = pipe( ^^^^^ File "D:_RollingDepth_.venv\Lib\site-packages\torch\utils_contextlib.py", line 116, in decorate_context return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "D:_RollingDepth_\rollingdepth\rollingdepth_pipeline.py", line 135, in call pipe_output = self.forward( ^^^^^^^^^^^^^ File "D:_RollingDepth_.venv\Lib\site-packages\torch\utils_contextlib.py", line 116, in decorate_context return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "D:_RollingDepth_\rollingdepth\rollingdepth_pipeline.py", line 325, in forward depth_latent_coaligned = self.encode_rgb( ^^^^^^^^^^^^^^^^ File "D:_RollingDepth_\rollingdepth\rollingdepth_pipeline.py", line 688, in encode_rgb h = self.vae.encoder(batch) ^^^^^^^^^^^^^^^^^^^^^^^ File "D:_RollingDepth_.venv\Lib\site-packages\torch\nn\modules\module.py", line 1739, in wrapped_call_impl return self.call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:_RollingDepth.venv\Lib\site-packages\torch\nn\modules\module.py", line 1750, in call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:_RollingDepth\diffusers\src\diffusers\models\autoencoders\vae.py", line 143, in forward sample = self.conv_in(sample) ^^^^^^^^^^^^^^^^^^^^ File "D:_RollingDepth.venv\Lib\site-packages\torch\nn\modules\module.py", line 1739, in _wrapped_call_impl return self.call_impl(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:_RollingDepth.venv\Lib\site-packages\torch\nn\modules\module.py", line 1750, in call_impl return forward_call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:_RollingDepth.venv\Lib\site-packages\torch\nn\modules\conv.py", line 554, in forward return self.conv_forward(input, self.weight, self.bias) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:_RollingDepth.venv\Lib\site-packages\torch\nn\modules\conv.py", line 549, in _conv_forward return F.conv2d( ^^^^^^^^^ RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument weight in method wrapper_CUDA___slow_conv2d_forward)

Rand0Pers0n avatar Apr 07 '25 03:04 Rand0Pers0n

Hi, seems like there is a library missing: ModuleNotFoundError: No module named 'triton'. I suggest checking the environment.

markkua avatar Apr 07 '25 09:04 markkua

Ok, I got triton for Windows or to work from: https://github.com/woct0rdho/triton-windows Still has the issue, looked around and changed line 112 in depth_aligner to cuda from cpu: device=torch.device("cuda"), Seems ok now.

Rand0Pers0n avatar Apr 07 '25 14:04 Rand0Pers0n