Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Loading large tabert_large_k3 giving span_based_prediction.prediction.decoder.bias error #4

Open
monk1337 opened this issue Jul 14, 2020 · 5 comments

Comments

@monk1337
Copy link

RuntimeError                              Traceback (most recent call last)
<ipython-input-5-04c64c2dedcc> in <module>
      1 from table_bert import TableBertModel
      2 
----> 3 model = TableBertModel.from_pretrained('/home/ankit_pal/TaBERT/tabert_large_k3/model.bin')

~/TaBERT/table_bert/table_bert.py in from_pretrained(cls, model_name_or_path, config_file, config, state_dict, **kwargs)
    235                 state_dict[new_key] = state_dict[old_key]
    236 
--> 237         model.load_state_dict(state_dict, strict=True)
    238 
    239         return model

~/TaBERT/table_bert/vanilla_table_bert.py in load_state_dict(self, state_dict, strict)
    314             self._bert_model.load_state_dict(state_dict, strict)
    315         else:
--> 316             super(VanillaTableBert, self).load_state_dict(state_dict, strict)

~/tfenv1/lib/python3.7/site-packages/torch/nn/modules/module.py in load_state_dict(self, state_dict, strict)
    845         if len(error_msgs) > 0:
    846             raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
--> 847                                self.__class__.__name__, "\n\t".join(error_msgs)))
    848         return _IncompatibleKeys(missing_keys, unexpected_keys)
    849 

RuntimeError: Error(s) in loading state_dict for VerticalAttentionTableBert:
	Missing key(s) in state_dict: "span_based_prediction.prediction.decoder.bias".
@pcyin
Copy link
Contributor

pcyin commented Jul 17, 2020

Thanks for reporting! Could you share the version of the pytorch-pretrained-bert library?

@niviksha
Copy link

Hi - I'm running into the same issue, can you tell me how I'd find the version of the library?

Thanks for reporting! Could you share the version of the pytorch-pretrained-bert library?

@zhangxinnan123
Copy link

Thanks for reporting! Could you share the version of the pytorch-pretrained-bert library?

Hi,I'm running with the same problem and the version of the pytorch-pretrained-bert is 0.6.2

@DevHyung
Copy link

Hi - I'm running into the same issue, can you tell me how I'd find the version of the library?

Thanks for reporting! Could you share the version of the pytorch-pretrained-bert library?

input the shell
$pip list | grep pytorch
and you can find the pytorch-pretrained-bert version

@FeiWang96
Copy link

FeiWang96 commented Jan 27, 2021

The version given in env.yaml works well for me.

pip install "--editable=git+https://github.com/huggingface/transformers.git@372a5c1ceec49b52c503707e9657bfaae7c236a0#egg=pytorch_pretrained_bert"

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

No branches or pull requests

6 participants