Tune-A-Video
Tune-A-Video copied to clipboard
RuntimeError: Expected to have finished reduction in the prior iteration before starting a new one.
Hi, I am facing the error message described below while training on my RTX 4090 GPU. I've adjusted the frame number to avoid exceeding the memory limitation, and left the remaining code unchanged. However, the training process could not function properly. Besides, I've seen someone posted similar issue previously, though I did not understand how did he solve his problem. Thus, I'm posting this issue again to ask for help. Thanks!
The following values were not passed to accelerate launch
and had defaults used instead:
More than one GPU was found, enabling multi-GPU training.
If this was unintended please pass in --num_processes=1
.
--num_machines
was set to a value of 1
--mixed_precision
was set to a value of 'no'
--dynamo_backend
was set to a value of 'no'
To avoid this warning pass in values for each of the problematic parameters or run accelerate config
.
07/17/2023 05:25:57 - INFO - main - Distributed environment: MULTI_GPU Backend: nccl
Num processes: 1
Process index: 0
Local process index: 0
Device: cuda:0
Mixed precision type: fp16
{'variance_type', 'prediction_type'} was not found in config. Values will be initialized to default values.
The config attributes {'scaling_factor': 0.18215} were passed to AutoencoderKL, but are not expected and will be ignored. Please verify your config.json configuration file.
{'norm_num_groups'} was not found in config. Values will be initialized to default values.
{'only_cross_attention', 'class_embed_type', 'upcast_attention', 'resnet_time_scale_shift', 'dual_cross_attention', 'mid_block_type', 'num_class_embeds', 'use_linear_projection'} was not found in config. Values will be initialized to default values.
{'prediction_type'} was not found in config. Values will be initialized to default values.
{'prediction_type'} was not found in config. Values will be initialized to default values.
07/17/2023 05:26:02 - INFO - main - ***** Running training *****
07/17/2023 05:26:02 - INFO - main - Num examples = 1
07/17/2023 05:26:02 - INFO - main - Num Epochs = 500
07/17/2023 05:26:02 - INFO - main - Instantaneous batch size per device = 1
07/17/2023 05:26:02 - INFO - main - Total train batch size (w. parallel, distributed & accumulation) = 1
07/17/2023 05:26:02 - INFO - main - Gradient Accumulation steps = 1
07/17/2023 05:26:02 - INFO - main - Total optimization steps = 500
Steps: 0%| | 0/500 [00:00<?, ?it/s]
/home/clhsieh/miniconda3/envs/tune_a_video/lib/python3.10/site-packages/torch/utils/checkpoint.py:25: UserWarning: None of the inputs have requires_grad=True. Gradients will be None
warnings.warn("None of the inputs have requires_grad=True. Gradients will be None")
Steps: 0%|▍ | 1/500 [00:01<10:49, 1.30s/it, lr=3e-5, step_loss=0.00935]
Traceback (most recent call last):
File "/home/clhsieh/video_editing/Tune-A-Video/train_tuneavideo.py", line 374, in find_unused_parameters=True
to torch.nn.parallel.DistributedDataParallel
, and by
making sure all forward
function outputs participate in calculating loss.
If you already have done the above, then the distributed data parallel module wasn't able to locate the output tensors in the return value of your module's forward
function. Please include the loss function and the structure of the return value of forward
of your module when reporting this issue (e.g. list, dict, iterable).
Parameter indices which did not receive grad for rank 0: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
In addition, you can set the environment variable TORCH_DISTRIBUTED_DEBUG to either INFO or DETAIL to print out information about which particular parameters did not receive gradient on this rank as part of this error
Steps: 0%|▍ | 1/500 [00:01<12:45, 1.53s/it, lr=3e-5, step_loss=0.00935]
ERROR:torch.distributed.elastic.multiprocessing.api:failed (exitcode: 1) local_rank: 0 (pid: 44880) of binary: /home/clhsieh/miniconda3/envs/tune_a_video/bin/python
Traceback (most recent call last):
File "/home/clhsieh/miniconda3/envs/tune_a_video/bin/accelerate", line 8, in
I have the same question
Specifying one GPU like "export CUDA_VISIBLE_DEVICES=0" works for me