# Electra-base returns always same output

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Felectra-base-returns-always-same-output%2F31158%3E%5C
**Category:** 🤗Transformers\
**Created:** [February 5, 2023, 7:10pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Felectra-base-returns-always-same-output%2F31158 "2023-02-05T19:10:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stistko](https://avatars.discourse-cdn.com/v4/letter/s/e8c25b/32.png) [@stistko](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fstistko)%5C
**Post date:** [February 5, 2023, 7:10pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Felectra-base-returns-always-same-output%2F31158%2F1 "2023-02-05T19:10:37Z")

</div>

I pretrained Electra-base model using [Google-electra](https://github.com/google-research/electra)

In hparams i had only set “model\_type:base”

Then i converted checkpoints using this [script](https://github.com/lonePatient/electra_pytorch)

with setting:

```auto
{
  "vocab_size": 30522,
  "embedding_size": 768,
  "hidden_size": 768,
  "num_hidden_layers": 12,
  "num_attention_heads": 12,
  "intermediate_size": 3072,
  "generator_size": "1/4",
  "hidden_act": "gelu",
  "hidden_dropout_prob": 0.1,
  "attention_probs_dropout_prob": 0.1,
  "max_position_embeddings": 512,
  "type_vocab_size": 2,
  "initializer_range": 0.02,
  "model_type": "electra"
}

```

I’m loading model with:

```auto
discriminator = AutoModel.from_pretrained("./electraBase")

```

and my output is always constant vector.

```auto
tensor([[2.4182, -0.0906, -1.5302, ..., 6.7738, 0.4463, 0.0859],
        [2.4182, -0.0906, -1.5302, ..., 6.7738, 0.4463, 0.0859],
        [2.4182, -0.0906, -1.5302, ..., 6.7738, 0.4463, 0.0859],
        [2.4182, -0.0906, -1.5302, ..., 6.7738, 0.4463, 0.0859]],
       grad_fn=<SliceBackward0>)

```

Is something wrong in loading process?
