stablediffusion icon indicating copy to clipboard operation
stablediffusion copied to clipboard

.half call to fix?

Open KyonP opened this issue 2 years ago • 2 comments

I am sorry that I cannot provide my python Traceback log (already reverted my code, sadly).

I was trying to update my previous code based on SD v1, I faced the error message : Input type (torch.cuda.HalfTensor) and weight type (torch.cuda.FloatTensor) should be the same conv2d

Since I haven't modified the core part of the model, I thought this error came from the compatibility issue between my custom-made code.

However, I couldn't find where HalfTensor came from. And I found this line from SD v2 code a while after reverting my code : return checkpoint(self._forward, (x,), self.parameters(), True) # TODO: check checkpoint usage, is True # TODO: fix the .half call!!!

I am wondering where is the ".half call" to fix; it might solve my 2nd attempt for the patch. 👍

KyonP avatar Nov 25 '22 14:11 KyonP

the tensor needs to be .half(). So wherever it's being decoded just add .half() to the end of the final tensor

richservo avatar Nov 30 '22 03:11 richservo

Last time I got this issue, I fixed by upgrading transformers' lib

pip install --upgrade git+https://github.com/huggingface/diffusers.git transformers accelerate scipy

nguyenmeteorops avatar Dec 06 '22 18:12 nguyenmeteorops