bert-relation-classification icon indicating copy to clipboard operation
bert-relation-classification copied to clipboard

error

Open ybwdsg opened this issue 4 years ago • 1 comments

when i type
python bert.py --config config.ini

Traceback (most recent call last): File "bert.py", line 427, in main() File "bert.py", line 357, in main config.pretrained_model_name, config=bertconfig) File "/usr/local/lib/python3.6/dist-packages/pytorch_transformers/modeling_utils.py", line 536, in from_pretrained model = cls(config, *model_args, **model_kwargs) File "/content/drive/My Drive/bert-relation-classification-master/model.py", line 66, in init self.apply(self.init_weights) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 440, in apply module.apply(fn) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 440, in apply module.apply(fn) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 440, in apply module.apply(fn) File "/usr/local/lib/python3.6/dist-packages/torch/nn/modules/module.py", line 441, in apply fn(self) TypeError: init_weights() takes 1 positional argument but 2 were given

ybwdsg avatar Sep 05 '20 03:09 ybwdsg

see readme. pytorch-transformers==1.1

wang-h avatar Sep 22 '20 04:09 wang-h