@Karthik12 …Is this issue solved by solution provided by @BramVanroy ? I am also getting same warning and model is not behaving correctly.
Same question has been asked in below:
  
    
    
    How to load weights for Pre-trained model for Question Answering? Beginners
  
  
    What should I change in below snippet to get consistent and accurate output? 
Code Snippet: 
from transformers import ElectraTokenizer, TFElectraForQuestionAnswering, ElectraConfig 
import tensorflow as tf 
configuration = ElectraConfig() 
tokenizer = ElectraTokenizer.from_pretrained(‘google/electra-small-discriminator’) 
TFElect = TFElectraForQuestionAnswering(configuration) 
#model = TFElectraForQuestionAnswering.from_pretrained(‘google/electra-small-discriminator’) 
model = TFElect.from_pretr…