# VisualBert Embeddings

**URL:** <https://discuss.huggingface.co/t/visualbert-embeddings/81575>\
**Category:** Models\
**Created:** [April 13, 2024, 3:38pm UTC](https://discuss.huggingface.co/t/visualbert-embeddings/81575 "2024-04-13T15:38:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![torium](https://avatars.discourse-cdn.com/v4/letter/t/919ad9/32.png) [@torium](https://discuss.huggingface.co/u/torium)\
**Post date:** [April 13, 2024, 3:38pm UTC](https://discuss.huggingface.co/t/visualbert-embeddings/81575/1 "2024-04-13T15:38:38Z")

</div>

Hi! I am trying to fine tune VisualBert for a classification task but right now it is randomly predicting only one of the two classes that I have. I am thinking that it might be the way I am retrieving the visual embeddings. I am using resnet50 and I get the features from this line of code:  
`detector = torchvision.models.resnet50(pretrained=True) detector = torch.nn.Sequential(*list(detector.children())[:-1])`

does anyone know if these embeddings actually work with VisualBert? I read that it typically needs embeddings from an object detector but since I am only classifying image-sentence pairs I thought that this network could also work. Thanks!
