ryudrigo / my-gen-clip

In-progress implementation of GEN-CLIP
6 stars 3 forks source link

please help me #2

Open xiaoxiaodadada opened 3 months ago

xiaoxiaodadada commented 3 months ago

clip_transformer.py 115 decode_to_img quant_z = self.first_stage_model.quantize.get_codebook_entry(

quantize.py 325 get_codebook_entry z_q = self.embedding(indices)

module.py 1130 _call_impl return forward_call(*input, **kwargs)

sparse.py 158 forward return F.embedding(

functional.py 2199 embedding return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)

RuntimeError: Expected tensor for argument #1 'indices' to have one of the following scalar types: Long, Int; but got torch.cuda.FloatTensor instead (while checking arguments for embedding)

xiaoxiaodadada commented 3 months ago

应该是decode_to_img这出现了问题

xiaoxiaodadada commented 3 months ago

new_x = decode_to_img(logits, x.shape) 这里的decode_to_img应该咋写,调用前面的肯定不对,如果能帮助我,我不胜感激