Skip to content

AttributeError: NEAREST_EXACT` #9

@Cubey42

Description

@Cubey42
│ I:\AnimateDiff-MotionDirector\train.py:1038 in <module>                                          │
│                                                                                                  │
│   1035 │   if getattr(config, "simple_mode", False):                                             │
│   1036 │   │   config = get_simple_config(config)                                                │
│   1037 │                                                                                         │
│ ❱ 1038 │   main(name=name, use_wandb=args.wandb, **config)                                       │
│   1039                                                                                           │
│                                                                                                  │
│ I:\AnimateDiff-MotionDirector\train.py:589 in main                                               │
│                                                                                                  │
│    586 │                                                                                         │
│    587 │   if cache_latents:                                                                     │
│    588 │   │   torch.multiprocessing.set_start_method('spawn')                                   │
│ ❱  589 │   │   train_dataloader = handle_cache_latents(                                          │
│    590 │   │   │   cache_latents,                                                                │
│    591 │   │   │   output_dir,                                                                   │
│    592 │   │   │   train_dataloader,                                                             │
│                                                                                                  │
│ I:\AnimateDiff-MotionDirector\train.py:168 in handle_cache_latents                               │
│                                                                                                  │
│    165 │   │   cache_save_dir = f"{output_dir}/cached_latents"                                   │
│    166 │   │   os.makedirs(cache_save_dir, exist_ok=True)                                        │
│    167 │   │                                                                                     │
│ ❱  168 │   │   for i, batch in enumerate(tqdm(train_dataloader, desc="Caching Latents.")):       │
│    169 │   │   │                                                                                 │
│    170 │   │   │   frames = batch['pixel_values'].shape[1]                                       │
│    171                                                                                           │
│                                                                                                  │
│ C:\Users\Lucas\anaconda3\envs\animatediff\lib\site-packages\tqdm\std.py:1182 in __iter__         │
│                                                                                                  │
│   1179 │   │   time = self._time                                                                 │
│   1180 │   │                                                                                     │
│   1181 │   │   try:                                                                              │
│ ❱ 1182 │   │   │   for obj in iterable:                                                          │
│   1183 │   │   │   │   yield obj                                                                 │
│   1184 │   │   │   │   # Update and possibly print the progressbar.                              │
│   1185 │   │   │   │   # Note: does not call self.update(1) for speed optimisation.              │
│                                                                                                  │
│ C:\Users\Lucas\anaconda3\envs\animatediff\lib\site-packages\torch\utils\data\dataloader.py:628   │
│ in __next__                                                                                      │
│                                                                                                  │
│    625 │   │   │   if self._sampler_iter is None:                                                │
│    626 │   │   │   │   # TODO(https://github.com/pytorch/pytorch/issues/76750)                   │
│    627 │   │   │   │   self._reset()  # type: ignore[call-arg]                                   │
│ ❱  628 │   │   │   data = self._next_data()                                                      │
│    629 │   │   │   self._num_yielded += 1                                                        │
│    630 │   │   │   if self._dataset_kind == _DatasetKind.Iterable and \                          │
│    631 │   │   │   │   │   self._IterableDataset_len_called is not None and \                    │
│                                                                                                  │
│ C:\Users\Lucas\anaconda3\envs\animatediff\lib\site-packages\torch\utils\data\dataloader.py:1333  │
│ in _next_data                                                                                    │
│                                                                                                  │
│   1330 │   │   │   │   self._task_info[idx] += (data,)                                           │
│   1331 │   │   │   else:                                                                         │
│   1332 │   │   │   │   del self._task_info[idx]                                                  │
│ ❱ 1333 │   │   │   │   return self._process_data(data)                                           │
│   1334 │                                                                                         │
│   1335 │   def _try_put_index(self):                                                             │
│   1336 │   │   assert self._tasks_outstanding < self._prefetch_factor * self._num_workers        │
│                                                                                                  │
│ C:\Users\Lucas\anaconda3\envs\animatediff\lib\site-packages\torch\utils\data\dataloader.py:1359  │
│ in _process_data                                                                                 │
│                                                                                                  │
│   1356 │   │   self._rcvd_idx += 1                                                               │
│   1357 │   │   self._try_put_index()                                                             │
│   1358 │   │   if isinstance(data, ExceptionWrapper):                                            │
│ ❱ 1359 │   │   │   data.reraise()                                                                │
│   1360 │   │   return data                                                                       │
│   1361 │                                                                                         │
│   1362 │   def _mark_worker_as_unavailable(self, worker_id, shutdown=False):                     │
│                                                                                                  │
│ C:\Users\Lucas\anaconda3\envs\animatediff\lib\site-packages\torch\_utils.py:543 in reraise       │
│                                                                                                  │
│   540 │   │   │   # If the exception takes multiple arguments, don't try to                      │
│   541 │   │   │   # instantiate since we don't know how to                                       │
│   542 │   │   │   raise RuntimeError(msg) from None                                              │
│ ❱ 543 │   │   raise exception                                                                    │
│   544                                                                                            │
│   545                                                                                            │
│   546 def _get_available_device_type():                                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
AttributeError: Caught AttributeError in DataLoader worker process 0.
Original Traceback (most recent call last):
  File "C:\Users\Lucas\anaconda3\envs\animatediff\lib\site-packages\torch\utils\data\_utils\worker.py", line 302, in
_worker_loop
    data = fetcher.fetch(index)
  File "C:\Users\Lucas\anaconda3\envs\animatediff\lib\site-packages\torch\utils\data\_utils\fetch.py", line 58, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "C:\Users\Lucas\anaconda3\envs\animatediff\lib\site-packages\torch\utils\data\_utils\fetch.py", line 58, in
<listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "C:\Users\Lucas\anaconda3\envs\animatediff\lib\site-packages\torch\utils\data\dataset.py", line 240, in
__getitem__
    return self.datasets[dataset_idx][sample_idx]
  File "I:\AnimateDiff-MotionDirector\animatediff\utils\dataset.py", line 460, in __getitem__
    video, prompt, prompt_ids = self.single_video_batch(index)
  File "I:\AnimateDiff-MotionDirector\animatediff\utils\dataset.py", line 443, in single_video_batch
    video, _ = self.process_video_wrapper(train_data)
  File "I:\AnimateDiff-MotionDirector\animatediff\utils\dataset.py", line 145, in process_video_wrapper
    video, vr = process_video(
  File "I:\AnimateDiff-MotionDirector\animatediff\utils\dataset.py", line 92, in process_video
    resize, height, width = get_frame_buckets(vr)
  File "I:\AnimateDiff-MotionDirector\animatediff\utils\dataset.py", line 136, in get_frame_buckets
    interpolation=torchvision.transforms.InterpolationMode.NEAREST_EXACT
  File "C:\Users\Lucas\anaconda3\envs\animatediff\lib\enum.py", line 437, in __getattr__
    raise AttributeError(name) from None
AttributeError: NEAREST_EXACT```
Had some trouble with the repo but i'm not sure whats wrong here, changing the video source gives me a different error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions