RuntimeError: Input type (c10::Half) and bias type (float) should be the same

#7
by tiktok-legacy - opened

Hi folks,
Got this error when I was running the training colab. Do you have any clue? Below is more error logs. Thanks!

RuntimeError Traceback (most recent call last)
in
1 #@title Run training
2 import accelerate
----> 3 accelerate.notebook_launcher(training_function, args=(text_encoder, vae, unet))
4 for param in itertools.chain(unet.parameters(), text_encoder.parameters()):
5 if param.grad is not None:

6 frames
/usr/local/lib/python3.8/dist-packages/accelerate/launchers.py in notebook_launcher(function, args, num_processes, use_fp16, mixed_precision, use_port)
80 else:
81 print("Launching training on one CPU.")
---> 82 function(*args)
83 else:
84 if num_processes is None:

in training_function(text_encoder, vae, unet)
156
157 # Predict the noise residual
--> 158 noise_pred = unet(noisy_latents, timesteps, encoder_hidden_states).sample
159
160 # Get the target for loss depending on the prediction type

/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
1188 if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
1189 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1190 return forward_call(*input, **kwargs)
1191 # Do not call functions when jit is used
1192 full_backward_hooks, non_full_backward_hooks = [], []

/usr/local/lib/python3.8/dist-packages/diffusers/models/unet_2d_condition.py in forward(self, sample, timestep, encoder_hidden_states, class_labels, return_dict)
373
374 # 2. pre-process
--> 375 sample = self.conv_in(sample)
376
377 # 3. down

/usr/local/lib/python3.8/dist-packages/torch/nn/modules/module.py in _call_impl(self, *input, **kwargs)
1188 if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
1189 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1190 return forward_call(*input, **kwargs)
1191 # Do not call functions when jit is used
1192 full_backward_hooks, non_full_backward_hooks = [], []

/usr/local/lib/python3.8/dist-packages/torch/nn/modules/conv.py in forward(self, input)
461
462 def forward(self, input: Tensor) -> Tensor:
--> 463 return self._conv_forward(input, self.weight, self.bias)
464
465 class Conv3d(_ConvNd):

/usr/local/lib/python3.8/dist-packages/torch/nn/modules/conv.py in _conv_forward(self, input, weight, bias)
457 weight, bias, self.stride,
458 _pair(0), self.dilation, self.groups)
--> 459 return F.conv2d(input, weight, bias, self.stride,
460 self.padding, self.dilation, self.groups)
461

Sign up or log in to comment