Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue while loading the model #27

Closed
ujjawalcse opened this issue Dec 24, 2021 · 2 comments
Closed

Issue while loading the model #27

ujjawalcse opened this issue Dec 24, 2021 · 2 comments

Comments

@ujjawalcse
Copy link

ujjawalcse commented Dec 24, 2021

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
Copy link
Author

@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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant