CLIP icon indicating copy to clipboard operation
CLIP copied to clipboard

"None" gradients when using fine-tuned CLIP

Open sarahESL opened this issue 3 years ago • 0 comments

Using the following snippet gives "none" values for some CLIP parameters such as positional_embedding,

for name, p in self.model.named_parameters():
    print(p.grad)

where

    myclip, _ = clip.load(args.clip_vision_encoder, jit=False)
    checkpoint = torch.load(args.clip_path)
    myclip.load_state_dict(checkpoint['state_dict'])
    self.model = myclip.float()

Is this behavior expected?

sarahESL avatar Oct 27 '21 16:10 sarahESL