Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Unable to replicate Results

Aperta
#4 3 commenti 3 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
huggingface, python, pytorch

Direzione di ricerca

No repository files or tests are identified. Start by tracing load_model(args), the encoder and head construction, and the torch.load/model.head.load_state_dict path, then compare them with the paper and Hugging Face CLIP-ViT-L-14 setup; done means identifying why the initial BCE loss differs and documenting a reproducible result.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Hello,

I am currently trying to test your model's weights with some data, but I am encountering some issues. I have set up the final linear layer as per your design, and am using the Clip-Vit-L-14 weights from Hugging Face. Despite following the methodology outlined in your paper and implementing it in my own model, the results don't seem to match the expected outcomes.

Here is a brief outline of my current setup:

class SingleLayerHead(nn.Module):
    def __init__(self, input_size: int, output_size: int):
        super().__init__()
        self.fc = nn.Linear(input_size, output_size)

    def forward(self, features, **kwargs):
        return self.fc(features)

class ImageBatchClassifier(LightningModule):
    def __init__(
        self,
        config: Dict[str, Any],
        encoder: nn.Module,
        head: nn.Module,
        loss: nn.Module,
    ):
        super().__init__()
        self.config = config
        self.encoder = encoder
        self.head = head
        self.loss = loss

        # Here we freeze all the weights of the encoder
        for param in self.encoder.parameters():
            param.requires_grad = False

if __name__=="__main__":
    model = load_model(args)
    state_dict = torch.load("your_weights",map_location='cpu')
    state_dict = {'fc.'+k: v for k, v in state_dict.items()}
    model.head.load_state_dict(state_dict)

As can be seen, I've frozen all the weights of the encoder. When running the code, the initial Binary Cross Entropy (BCE) Loss is surprisingly high, starting around 5.

I'd appreciate any guidance or suggestions on what could be the possible reasons for this issue, and how to resolve it.

Thank you in advance

Edit.: This is not the working code, just an simple implementation idea

Lingua principale
Python
Stelle
378
Fork
59
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di WisconsinAIVision/UniversalFakeDetect

Tutte le issue di WisconsinAIVision/UniversalFakeDetect

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.