TIGER-AI-Lab / AnyV2V

Code and data for "AnyV2V: A Tuning-Free Framework For Any Video-to-Video Editing Tasks"
https://tiger-ai-lab.github.io/AnyV2V/
MIT License
462 stars 34 forks source link

RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu) #8

Closed 8600862 closed 2 months ago

8600862 commented 5 months ago

there is a error when i click 'run video editing' button in the gradio_demo, and i just choose a example at the end of the page. how to fix it?

Using seed: 65485
Loading pipeline components...:   0%|                                                                                                                                                            | 0/7 [00:00<?, ?it/s]The config attributes {'attention_head_dim': 64} were passed to I2VGenXLUNet, but are not expected and will be ignored. Please verify your config.json configuration file.
Loading pipeline components...: 100%|####################################################################################################################################################| 7/7 [00:00<00:00,  7.82it/s]
  1%|#7                                                                                                                                                                              | 1/100.0 [00:01<01:42,  1.03s/it]
Traceback (most recent call last):
  File "/server/anaconda3/envs/anyv2v/lib/python3.10/site-packages/gradio/routes.py", line 516, in predict
    output = await route_utils.call_process_api(
  File "/server/anaconda3/envs/anyv2v/lib/python3.10/site-packages/gradio/route_utils.py", line 219, in call_process_api
    output = await app.get_blocks().process_api(
  File "/server/anaconda3/envs/anyv2v/lib/python3.10/site-packages/gradio/blocks.py", line 1437, in process_api
    result = await self.call_function(
  File "/server/anaconda3/envs/anyv2v/lib/python3.10/site-packages/gradio/blocks.py", line 1109, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "/server/anaconda3/envs/anyv2v/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
  File "/server/anaconda3/envs/anyv2v/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2144, in run_sync_in_worker_thread
    return await future
  File "/server/anaconda3/envs/anyv2v/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 851, in run
    result = context.run(func, *args)
  File "/server/anaconda3/envs/anyv2v/lib/python3.10/site-packages/gradio/utils.py", line 650, in wrapper
    response = f(*args, **kwargs)
  File "/server/stablediffusion/text2video/AnyV2V/gradio_demo.py", line 303, in btn_infer_fn
    result_video_path = AnyV2V_Editor.perform_anyv2v(video_path=video_path,
  File "/server/anaconda3/envs/anyv2v/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/server/stablediffusion/text2video/AnyV2V/gradio_demo.py", line 142, in perform_anyv2v
    _ddim_latents = ddim_inversion(
  File "/server/stablediffusion/text2video/AnyV2V/i2vgen-xl/run_group_ddim_inversion.py", line 37, in ddim_inversion
    ddim_latents = pipe.invert(
  File "/server/anaconda3/envs/anyv2v/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "/server/stablediffusion/text2video/AnyV2V/i2vgen-xl/pipelines/pipeline_i2vgen_xl.py", line 1418, in invert
    latents = self.scheduler.step(noise_pred, t, latents, **extra_step_kwargs).prev_sample
  File "/server/anaconda3/envs/anyv2v/lib/python3.10/site-packages/diffusers/schedulers/scheduling_ddim_inverse.py", line 337, in step
    alpha_prod_t = self.alphas_cumprod[timestep] if timestep >= 0 else self.initial_alpha_cumprod
RuntimeError: indices should be either on cpu or on the same device as the indexed tensor (cpu)
vinesmsuic commented 5 months ago

Hi, can you provide more information about your hardware and software environment?

8600862 commented 5 months ago

Hi, can you provide more information about your hardware and software environment?

3090 python3.10-torch2.1.0, I can run it using run_group_ddim_inversion.py and run_group_pnp_edit.py as redme

vinesmsuic commented 5 months ago

This is weird, me and my collaborators was able to run all the scripts with the provided requirement.txt. Let's see if there are other people ran into same issue