OpenGVLab / LLaMA-Adapter

[ICLR 2024] Fine-tuning LLaMA to follow Instructions within 1 Hour and 1.2M Parameters

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Self and mat2 must have the same type

TeleeMa opened this issue · comments

Hi,

When I ran the forward function in

def forward(self, tokens, labels, imgs):
I met the following error
image

I printed out the dtype of the input and self.weight, self.bias
Screenshot 2023-08-28 at 11 57 32
, it showed the same dtype.

I solved the problem with the help of @csuhan .
with torch.cuda.amp.autocast():
is also needed in the inference process if forward function is called, like in

with torch.cuda.amp.autocast():

I will close the issue.