Input type (torch.cuda.HalfTensor) and weight type (torch.cuda.FloatTensor) should be the same
Kingwolf123 opened this issue · comments
Any type of image uploading to a free google colab and then executing it produces this error. Apparently the code is trying to execute the model on a cpu when it needs a gpu. This could mean some missing code? Everything else on my end is default, all i have done is hosted a colab notebook and asked it to remove an object from a photo that i have uploaded
Thank
No, the model is not executed on CPU, but one tensor is half-precision (cuda.HalfTensor) and the other full (cuda.FloatTensor).
The problem seems to be that the safety checker uses the wrong tensor format for its weights.
You can fix that by replacing ´StableDiffusionSafetyChecker.from_pretrained('CompVis/stable-diffusion-safety-checker')´
by
´StableDiffusionSafetyChecker.from_pretrained('CompVis/stable-diffusion-safety-checker', torch_dtype=self.torch_dtype)´ in visual_chatgpt.py.