awslabs / gap-text2sql

GAP-text2SQL: Learning Contextual Representations for Semantic Parsing with Generation-Augmented Pre-Training
https://arxiv.org/abs/2012.10309
Apache License 2.0
102 stars 25 forks source link

Issue while loading the model #27

Closed ujjawalcse closed 2 years ago

ujjawalcse commented 2 years ago

Hey @Impavidity @TheurgicDuke771 , I'm facing the same issue, I think there is no issue with data( Spider) I'm using.

Loading model from logdir/bart_run_1/bs=12,lr=1.0e-04,bert_lr=1.0e-05,end_lr=0e0,att=1/model_checkpoint-00041000

---------------------------------------------------------------------------

KeyError                                  Traceback (most recent call last)

<ipython-input-45-2534e992a832> in <module>()
----> 1 model = inferer.load_model(model_dir, checkpoint_step)

6 frames

/content/gap-text2sql/rat-sql-gap/seq2struct/models/variational_lstm.py in _hook_remove_dropout_masks_from_state_dict(cls, instance, state_dict, prefix, local_metadata)
     75     @classmethod
     76     def _hook_remove_dropout_masks_from_state_dict(cls, instance, state_dict, prefix, local_metadata):
---> 77         del state_dict[prefix + '_input_dropout_mask']
     78         del state_dict[prefix + '_h_dropout_mask']
     79 

KeyError: 'decoder.state_update._input_dropout_mask'

We can see the folder structure below, spider_data_issue

Please guide me to tackle this issue. Thanks in advance.

ujjawalcse commented 2 years ago

@Impavidity , Also, getting error in executing the following

dataset = registry.construct('dataset_infer',{
   "name": "spider", "schemas": schema, "eval_foreign_key_maps": eval_foreign_key_maps, 
    "db_path": "data/sqlite_files/"
})
ValueError                                Traceback (most recent call last)

<ipython-input-57-de0cacb4ab13> in <module>()
      1 dataset = registry.construct('dataset_infer',{
      2    "name": "spider", "schemas": schema, "eval_foreign_key_maps": eval_foreign_key_maps,
----> 3     "db_path": "data/sqlite_files/"
      4 })

1 frames

/content/gap-text2sql/rat-sql-gap/seq2struct/utils/registry.py in instantiate(callable, config, unused_keys, **kwargs)
     42     signature = inspect.signature(callable.__init__)
     43     print('signature:',signature)
---> 44     for name, param in signature.parameters.items():
     45         print("name:",name)
     46         print("param:",param)

ValueError: Unsupported kind for param args: 2

Please help me out. Thanks again.

ujjawalcse commented 2 years ago

Sorry, I was using pytorch 1.10 version. Running fine with pytorch 1.5 version. Thanks