ai-forever / ner-bert

BERT-NER (nert-bert) with google bert https://github.com/google-research.
MIT License
407 stars 97 forks source link

convert_tf_checkpoint_to_pytorch.py error #9

Closed mrmutator closed 5 years ago

mrmutator commented 5 years ago

Hi,

When running the conversion script convert_tf_checkpoint_to_pytorch.py I get the following error when trying to convert the BERT-Base, uncased model:

Traceback (most recent call last):
  File "convert_tf_checkpoint_to_pytorch.py", line 107, in <module>
    convert()
  File "convert_tf_checkpoint_to_pytorch.py", line 100, in convert
    pointer.data = torch.from_numpy(array)
TypeError: expected np.ndarray (got numpy.ndarray)

Any ideas? Thanks

OmGraja commented 5 years ago

Please provide more infos about the Bert model you are using. It worked for me in the case of BERT-Base, Uncased: 12-layer, 768-hidden, 12-heads, 110M parameters.

mrmutator commented 5 years ago

I'm also using the Bert model BERT-Base, Uncased: 12-layer, 768-hidden, 12-heads, 110M parameters. But I get the error above on Windows with Pytorch 1.01 and Tensorflow 1.13.0rc2

OmGraja commented 5 years ago

Windows does not support some of ner-bert packages and libraries. I recommend that you implement it on linux OS or MacOS. A lot of bugs will occur if you implement it on windows.

king-menin commented 5 years ago

All experiments have done on linux :).