lllyasviel / Paints-UNDO

Understand Human Behavior to Align True Needs
Apache License 2.0
3.25k stars 287 forks source link

Error generating Video #54

Open scooller opened 1 month ago

scooller commented 1 month ago

I have this error when try to generate video I had an error before with Cuda but execute this line of code pip install torch==2.3.0 torchvision torchaudio xformers --index-url https://download.pytorch.org/whl/cu121

Unload to CPU: AutoencoderKL
Load to GPU: CLIPTextModel
Unload to CPU: CLIPTextModel
Load to GPU: ModifiedUNet
Unload to CPU: ModifiedUNet
Load to GPU: AutoencoderKL
Unload to CPU: AutoencoderKL
Load to GPU: CLIPTextModel
Unload to CPU: CLIPTextModel
Load to GPU: ImprovedCLIPVisionModelWithProjection
Load to GPU: Resampler
Traceback (most recent call last):
  File "C:\Users\scool\.conda\envs\paints_undo\lib\site-packages\gradio\queueing.py", line 528, in process_events
    response = await route_utils.call_process_api(
  File "C:\Users\scool\.conda\envs\paints_undo\lib\site-packages\gradio\route_utils.py", line 270, in call_process_api
    output = await app.get_blocks().process_api(
  File "C:\Users\scool\.conda\envs\paints_undo\lib\site-packages\gradio\blocks.py", line 1908, in process_api
    result = await self.call_function(
  File "C:\Users\scool\.conda\envs\paints_undo\lib\site-packages\gradio\blocks.py", line 1485, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\Users\scool\AppData\Roaming\Python\Python310\site-packages\anyio\to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
  File "C:\Users\scool\AppData\Roaming\Python\Python310\site-packages\anyio\_backends\_asyncio.py", line 2144, in run_sync_in_worker_thread
    return await future
  File "C:\Users\scool\AppData\Roaming\Python\Python310\site-packages\anyio\_backends\_asyncio.py", line 851, in run
    result = context.run(func, *args)
  File "C:\Users\scool\.conda\envs\paints_undo\lib\site-packages\gradio\utils.py", line 808, in wrapper
    response = f(*args, **kwargs)
  File "C:\Users\scool\.conda\envs\paints_undo\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "I:\Paints-UNDO\gradio_app.py", line 222, in process_video
    frames, im1, im2 = process_video_inner(
  File "C:\Users\scool\.conda\envs\paints_undo\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "I:\Paints-UNDO\gradio_app.py", line 183, in process_video_inner
    positive_image_cond = video_pipe.encode_clip_vision(input_frames)
  File "C:\Users\scool\.conda\envs\paints_undo\lib\site-packages\torch\utils\_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
  File "I:\Paints-UNDO\diffusers_vdm\pipeline.py", line 93, in encode_clip_vision
    frames = einops.rearrange(frames, 'b c t h w -> (b t) c h w')
  File "C:\Users\scool\.conda\envs\paints_undo\lib\site-packages\einops\einops.py", line 591, in rearrange
    return reduce(tensor, pattern, reduction="rearrange", **axes_lengths)
  File "C:\Users\scool\.conda\envs\paints_undo\lib\site-packages\einops\einops.py", line 518, in reduce
    backend = get_backend(tensor)
  File "C:\Users\scool\.conda\envs\paints_undo\lib\site-packages\einops\_backends.py", line 55, in get_backend
    if backend.is_appropriate_type(tensor):
  File "C:\Users\scool\.conda\envs\paints_undo\lib\site-packages\einops\_backends.py", line 408, in is_appropriate_type
    return isinstance(tensor, (self.tf.Tensor, self.tf.Variable))
AttributeError: module 'tensorflow' has no attribute 'Tensor'
yayoyo66 commented 1 month ago

If you update the version of torch, the versions of other libraries must also be updated to match the new version of torch.

This can be a complicated problem for people who have no experience in deep learning, so I recommend that you re-install an environment, first install torch using the command pip install torch==2.3.0 torchvision torchaudio xformers --index-url https://download.pytorch.org/whl/cu121,

Then install other libraries and they will automatically match your torch version

victorca25 commented 1 month ago

I would recommend to use VENVs if possible and maintain the dependencies of each application separate, that way you will avoid causing issues due to incompatible versions of the libraries

scooller commented 1 month ago

I try again and the same error come out, and when install i have this message

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
albumentations 1.3.1 requires scipy>=1.1.0, which is not installed.
basicsr 1.4.2 requires opencv-python, which is not installed.
basicsr 1.4.2 requires scipy, which is not installed.
basicsr 1.4.2 requires tqdm, which is not installed.
facexlib 0.3.0 requires opencv-python, which is not installed.
facexlib 0.3.0 requires scipy, which is not installed.
facexlib 0.3.0 requires tqdm, which is not installed.
filterpy 1.4.5 requires scipy, which is not installed.
gfpgan 1.3.8 requires opencv-python, which is not installed.
gfpgan 1.3.8 requires scipy, which is not installed.
gfpgan 1.3.8 requires tqdm, which is not installed.
insightface 0.7.3 requires onnx, which is not installed.
insightface 0.7.3 requires scipy, which is not installed.
insightface 0.7.3 requires tqdm, which is not installed.
jax 0.4.24 requires scipy>=1.9, which is not installed.
keras-nightly 3.0.4.dev2024021403 requires rich, which is not installed.
opennsfw2 0.10.2 requires opencv-python>=4.0.0.0, which is not installed.
opennsfw2 0.10.2 requires tensorflow>=2.0.0, which is not installed.
opennsfw2 0.10.2 requires tqdm>=4.62, which is not installed.
scikit-image 0.22.0 requires scipy>=1.8, which is not installed.
scikit-learn 1.4.0 requires scipy>=1.6.0, which is not installed.
tb-nightly 2.16.0a20240212 requires protobuf!=4.24.0,>=3.19.6, which is not installed.
tf-nightly-intel 2.17.0.dev20240213 requires protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.20.3, which is not installed.