Here is the complete log:
04/19 14:44:16 - mmengine - INFO - Creating Linaqruf/anything-v3.0 by 'HuggingFace'
/home/wushuchen/projects/SAM_test/mmediting/mmedit/models/base_archs/wrapper.py:129: FutureWarning: Accessing config attribute block_out_channels
directly via 'AutoencoderKL' object attribute is deprecated. Please access 'block_out_channels' over 'AutoencoderKL's config object instead, e.g. 'unet.config.block_out_channels'.
return getattr(self.model, name)
100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 15/15 [00:02<00:00, 5.54it/s]
0%| | 0/15 [00:00<?, ?it/s]
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/wushuchen/projects/SAM_test/playground/mmediting_sam/play_controlnet_animation_sam.py:108 │
│ in │
│ │
│ 105 │ init_default_scope('mmedit') │
│ 106 │ │
│ 107 │ # 1. generate animation with mmediting controlnet animation │
│ ❱ 108 │ generate_animation( │
│ 109 │ │ video=config.source_video_frame_path, │
│ 110 │ │ save_path=config.middle_video_frame_path, │
│ 111 │ │ prompt=config.prompt, │
│ │
│ /home/wushuchen/projects/SAM_test/playground/mmediting_sam/play_controlnet_animation_sam.py:19 │
│ in generate_animation │
│ │
│ 16 │ │ │ │ │ height): │
│ 17 │ editor = MMEdit(model_name='controlnet_animation') │
│ 18 │ │
│ ❱ 19 │ editor.infer( │
│ 20 │ │ video=video, │
│ 21 │ │ prompt=prompt, │
│ 22 │ │ negative_prompt=negative_prompt, │
│ │
│ /home/wushuchen/projects/SAM_test/mmediting/mmedit/edit.py:199 in infer │
│ │
│ 196 │ │ │ Dict or List[Dict]: Each dict contains the inference result of │
│ 197 │ │ │ each image or video. │
│ 198 │ │ """ │
│ ❱ 199 │ │ return self.inferencer( │
│ 200 │ │ │ img=img, │
│ 201 │ │ │ video=video, │
│ 202 │ │ │ label=label, │
│ │
│ /home/wushuchen/projects/SAM_test/mmediting/mmedit/apis/inferencers/init.py:116 in call │
│ │
│ 113 │ │ Returns: │
│ 114 │ │ │ Union[Dict, List[Dict]]: Results of inference pipeline. │
│ 115 │ │ """ │
│ ❱ 116 │ │ return self.inferencer(**kwargs) │
│ 117 │ │
│ 118 │ def get_extra_parameters(self) -> List[str]: │
│ 119 │ │ """Each inferencer may has its own parameters. Call this function to │
│ │
│ /home/wushuchen/anaconda3/envs/mmedit-sam/lib/python3.8/site-packages/torch/autograd/grad_mode.p │
│ y:27 in decorate_context │
│ │
│ 24 │ │ @functools.wraps(func) │
│ 25 │ │ def decorate_context(*args, **kwargs): │
│ 26 │ │ │ with self.clone(): │
│ ❱ 27 │ │ │ │ return func(*args, **kwargs) │
│ 28 │ │ return cast(F, decorate_context) │
│ 29 │ │
│ 30 │ def _wrap_generator(self, func): │
│ │
│ /home/wushuchen/projects/SAM_test/mmediting/mmedit/apis/inferencers/controlnet_animation_inferen │
│ cer.py:208 in call │
│ │
│ 205 │ │ │ concat_hed.paste(hed_image, (image_width, 0)) │
│ 206 │ │ │ concat_hed.paste(first_hed, (image_width * 2, 0)) │
│ 207 │ │ │ │
│ ❱ 208 │ │ │ result = self.pipe.infer( │
│ 209 │ │ │ │ control=concat_hed, │
│ 210 │ │ │ │ latent_image=concat_img, │
│ 211 │ │ │ │ prompt=prompt, │
│ │
│ /home/wushuchen/anaconda3/envs/mmedit-sam/lib/python3.8/site-packages/torch/autograd/grad_mode.p │
│ y:27 in decorate_context │
│ │
│ 24 │ │ @functools.wraps(func) │
│ 25 │ │ def decorate_context(*args, **kwargs): │
│ 26 │ │ │ with self.clone(): │
│ ❱ 27 │ │ │ │ return func(*args, **kwargs) │
│ 28 │ │ return cast(F, decorate_context) │
│ 29 │ │
│ 30 │ def _wrap_generator(self, func): │
│ │
│ /home/wushuchen/projects/SAM_test/mmediting/mmedit/models/editors/controlnet/controlnet.py:806 │
│ in infer │
│ │
│ 803 │ │ │ latent_model_input = self.test_scheduler.scale_model_input( │
│ 804 │ │ │ │ latent_model_input, t) │
│ 805 │ │ │ │
│ ❱ 806 │ │ │ down_block_res_samples, mid_block_res_sample = self.controlnet( │
│ 807 │ │ │ │ latent_model_input, │
│ 808 │ │ │ │ t, │
│ 809 │ │ │ │ encoder_hidden_states=text_embeddings, │
│ │
│ /home/wushuchen/anaconda3/envs/mmedit-sam/lib/python3.8/site-packages/torch/nn/modules/module.py │
│ :1130 in _call_impl │
│ │
│ 1127 │ │ # this function, and just call forward. │
│ 1128 │ │ if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks o │
│ 1129 │ │ │ │ or _global_forward_hooks or _global_forward_pre_hooks): │
│ ❱ 1130 │ │ │ return forward_call(*input, **kwargs) │
│ 1131 │ │ # Do not call functions when jit is used │
│ 1132 │ │ full_backward_hooks, non_full_backward_hooks = [], [] │
│ 1133 │ │ if self._backward_hooks or _global_backward_hooks: │
│ │
│ /home/wushuchen/projects/SAM_test/mmediting/mmedit/models/base_archs/wrapper.py:159 in forward │
│ │
│ 156 │ │ Returns: │
│ 157 │ │ │ Any: The output of wrapped module's forward function. │
│ 158 │ │ """ │
│ ❱ 159 │ │ return self.model(*args, **kwargs) │
│ 160 │
│ │
│ /home/wushuchen/anaconda3/envs/mmedit-sam/lib/python3.8/site-packages/torch/nn/modules/module.py │
│ :1130 in _call_impl │
│ │
│ 1127 │ │ # this function, and just call forward. │
│ 1128 │ │ if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks o │
│ 1129 │ │ │ │ or _global_forward_hooks or _global_forward_pre_hooks): │
│ ❱ 1130 │ │ │ return forward_call(*input, **kwargs) │
│ 1131 │ │ # Do not call functions when jit is used │
│ 1132 │ │ full_backward_hooks, non_full_backward_hooks = [], [] │
│ 1133 │ │ if self._backward_hooks or _global_backward_hooks: │
│ │
│ /home/wushuchen/anaconda3/envs/mmedit-sam/lib/python3.8/site-packages/diffusers/models/controlne │
│ t.py:525 in forward │
│ │
│ 522 │ │ down_block_res_samples = (sample,) │
│ 523 │ │ for downsample_block in self.down_blocks: │
│ 524 │ │ │ if hasattr(downsample_block, "has_cross_attention") and downsample_block.has │
│ ❱ 525 │ │ │ │ sample, res_samples = downsample_block( │
│ 526 │ │ │ │ │ hidden_states=sample, │
│ 527 │ │ │ │ │ temb=emb, │
│ 528 │ │ │ │ │ encoder_hidden_states=encoder_hidden_states, │
│ │
│ /home/wushuchen/anaconda3/envs/mmedit-sam/lib/python3.8/site-packages/torch/nn/modules/module.py │
│ :1130 in _call_impl │
│ │
│ 1127 │ │ # this function, and just call forward. │
│ 1128 │ │ if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks o │
│ 1129 │ │ │ │ or _global_forward_hooks or _global_forward_pre_hooks): │
│ ❱ 1130 │ │ │ return forward_call(*input, **kwargs) │
│ 1131 │ │ # Do not call functions when jit is used │
│ 1132 │ │ full_backward_hooks, non_full_backward_hooks = [], [] │
│ 1133 │ │ if self._backward_hooks or _global_backward_hooks: │
│ │
│ /home/wushuchen/anaconda3/envs/mmedit-sam/lib/python3.8/site-packages/diffusers/models/unet_2d_b │
│ locks.py:867 in forward │
│ │
│ 864 │ │ │ │ )[0] │
│ 865 │ │ │ else: │
│ 866 │ │ │ │ hidden_states = resnet(hidden_states, temb) │
│ ❱ 867 │ │ │ │ hidden_states = attn( │
│ 868 │ │ │ │ │ hidden_states, │
│ 869 │ │ │ │ │ encoder_hidden_states=encoder_hidden_states, │
│ 870 │ │ │ │ │ cross_attention_kwargs=cross_attention_kwargs, │
│ │
│ /home/wushuchen/anaconda3/envs/mmedit-sam/lib/python3.8/site-packages/torch/nn/modules/module.py │
│ :1130 in _call_impl │
│ │
│ 1127 │ │ # this function, and just call forward. │
│ 1128 │ │ if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks o │
│ 1129 │ │ │ │ or _global_forward_hooks or _global_forward_pre_hooks): │
│ ❱ 1130 │ │ │ return forward_call(*input, **kwargs) │
│ 1131 │ │ # Do not call functions when jit is used │
│ 1132 │ │ full_backward_hooks, non_full_backward_hooks = [], [] │
│ 1133 │ │ if self._backward_hooks or _global_backward_hooks: │
│ │
│ /home/wushuchen/anaconda3/envs/mmedit-sam/lib/python3.8/site-packages/diffusers/models/transform │
│ er_2d.py:265 in forward │
│ │
│ 262 │ │ │
│ 263 │ │ # 2. Blocks │
│ 264 │ │ for block in self.transformer_blocks: │
│ ❱ 265 │ │ │ hidden_states = block( │
│ 266 │ │ │ │ hidden_states, │
│ 267 │ │ │ │ encoder_hidden_states=encoder_hidden_states, │
│ 268 │ │ │ │ timestep=timestep, │
│ │
│ /home/wushuchen/anaconda3/envs/mmedit-sam/lib/python3.8/site-packages/torch/nn/modules/module.py │
│ :1130 in _call_impl │
│ │
│ 1127 │ │ # this function, and just call forward. │
│ 1128 │ │ if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks o │
│ 1129 │ │ │ │ or _global_forward_hooks or _global_forward_pre_hooks): │
│ ❱ 1130 │ │ │ return forward_call(*input, **kwargs) │
│ 1131 │ │ # Do not call functions when jit is used │
│ 1132 │ │ full_backward_hooks, non_full_backward_hooks = [], [] │
│ 1133 │ │ if self._backward_hooks or _global_backward_hooks: │
│ │
│ /home/wushuchen/anaconda3/envs/mmedit-sam/lib/python3.8/site-packages/diffusers/models/attention │
│ .py:294 in forward │
│ │
│ 291 │ │ │ norm_hidden_states = self.norm1(hidden_states) │
│ 292 │ │ │
│ 293 │ │ cross_attention_kwargs = cross_attention_kwargs if cross_attention_kwargs is not │
│ ❱ 294 │ │ attn_output = self.attn1( │
│ 295 │ │ │ norm_hidden_states, │
│ 296 │ │ │ encoder_hidden_states=encoder_hidden_states if self.only_cross_attention els │
│ 297 │ │ │ attention_mask=attention_mask, │
│ │
│ /home/wushuchen/anaconda3/envs/mmedit-sam/lib/python3.8/site-packages/torch/nn/modules/module.py │
│ :1130 in _call_impl │
│ │
│ 1127 │ │ # this function, and just call forward. │
│ 1128 │ │ if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks o │
│ 1129 │ │ │ │ or _global_forward_hooks or _global_forward_pre_hooks): │
│ ❱ 1130 │ │ │ return forward_call(*input, **kwargs) │
│ 1131 │ │ # Do not call functions when jit is used │
│ 1132 │ │ full_backward_hooks, non_full_backward_hooks = [], [] │
│ 1133 │ │ if self._backward_hooks or _global_backward_hooks: │
│ │
│ /home/wushuchen/anaconda3/envs/mmedit-sam/lib/python3.8/site-packages/diffusers/models/attention │
│ _processor.py:243 in forward │
│ │
│ 240 │ │ # The Attention
class can call different attention processors / attention func │
│ 241 │ │ # here we simply pass along all tensors to the selected processor class │
│ 242 │ │ # For standard processors that are defined here, **cross_attention_kwargs
is e │
│ ❱ 243 │ │ return self.processor( │
│ 244 │ │ │ self, │
│ 245 │ │ │ hidden_states, │
│ 246 │ │ │ encoder_hidden_states=encoder_hidden_states, │
│ │
│ /home/wushuchen/anaconda3/envs/mmedit-sam/lib/python3.8/site-packages/diffusers/models/attention │
│ _processor.py:382 in call │
│ │
│ 379 │ │ key = attn.head_to_batch_dim(key) │
│ 380 │ │ value = attn.head_to_batch_dim(value) │
│ 381 │ │ │
│ ❱ 382 │ │ attention_probs = attn.get_attention_scores(query, key, attention_mask) │
│ 383 │ │ hidden_states = torch.bmm(attention_probs, value) │
│ 384 │ │ hidden_states = attn.batch_to_head_dim(hidden_states) │
│ 385 │
│ │
│ /home/wushuchen/anaconda3/envs/mmedit-sam/lib/python3.8/site-packages/diffusers/models/attention │
│ _processor.py:284 in get_attention_scores │
│ │
│ 281 │ │ │ baddbmm_input = attention_mask │
│ 282 │ │ │ beta = 1 │
│ 283 │ │ │
│ ❱ 284 │ │ attention_scores = torch.baddbmm( │
│ 285 │ │ │ baddbmm_input, │
│ 286 │ │ │ query, │
│ 287 │ │ │ key.transpose(-1, -2), │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
RuntimeError: CUDA out of memory. Tried to allocate 9.00 GiB (GPU 0; 23.67 GiB total capacity; 14.61 GiB already allocated; 4.53 GiB free; 14.82 GiB 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