Runtime Error with importing TableTransformerForObjectDetection

#10
by stargazer20 - opened

hi, I was trying the DETR table transformers example notebook by @nielsr . Just a week back it was running all fine step by step on Google Colab notebook. However, I encountered the error while executing this line two days back:
from transformers import TableTransformerForObjectDetection
Please let me know what is wrong here. Has the main code changed or is it an issue because I am using a Google Colab notebook, CPU resource. Any help is much appreciated.
Screen Shot 2023-10-28 at 4.49.44 PM.png

I got this error fixed by using this line of code : from torch.utils.checkpoint import checkpoint
However, it returns this message below hashes (possibly because this line of code is a fix for BertFOrPreTraining model:
############################################################################################
Some weights of the model checkpoint at microsoft/table-transformer-detection were not used when initializing TableTransformerForObjectDetection: ['model.backbone.conv_encoder.model.layer3.0.downsample.1.num_batches_tracked', 'model.backbone.conv_encoder.model.layer4.0.downsample.1.num_batches_tracked', 'model.backbone.conv_encoder.model.layer2.0.downsample.1.num_batches_tracked']

  • This IS expected if you are initializing TableTransformerForObjectDetection from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).
  • This IS NOT expected if you are initializing TableTransformerForObjectDetection from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).

##############################################################################################
Anyone, could you help me understand?
Screen Shot 2023-10-29 at 4.54.04 PM.png

Thanks

Sign up or log in to comment