Problems reproducing model export

#1
by Frank94 - opened

I can't reproduce the export of the model as you did. I get the error: Some weights of the model checkpoint at lilt-distilroberta-base were not used when initializing LiltForTokenClassification. Trying with your model the error does not appear. The colab I'm testing with is the following: https://colab.research.google.com/drive/1k2uGoDBOQwrK4iokGJOQKdDfll0QPbl-#scrollTo=0ZmvE7ku4hSW.

Can you help me figure out what I'm doing wrong? Thanks in advance

Hi @Frank94 , i'm not quite sure what might be the error in your case, but I remember also having problems at first while creating a LiLT model using distilroberta.
If I recall correctly, here's two additional passage that I had to do:

  1. I had to manually download the pytorch_model.bin and config.json files from the hub because for some reasons using wget led me to some error
  2. I changed a couple of lines of the original get_weight_roberta_like.py script. In particular

https://github.com/jpWang/LiLT/blob/main/gen_weight_roberta_like.py#L19
config['model_type'] = 'LiltModel' #changed from 'liltrobertalike'

https://github.com/jpWang/LiLT/blob/main/gen_weight_roberta_like.py#L26
text_model = torch.load(opt.text, map_location=torch.device('cpu')) #changed to cpu

https://github.com/jpWang/LiLT/blob/main/gen_weight_roberta_like.py#L28
lilt_model = torch.load(opt.lilt, map_location=torch.device('cpu')) #changed to cpu

Last two changes were made because I was working on cpu, I don't know if that is also your case.

Hope this helps :)

Hi @Sennodipoi ,
I'll try to do some tests as you suggested.
thanks for your support :)

Frank94 changed discussion status to closed

Sign up or log in to comment