transformers: TFBertModel.from_pretrained('neuralmind/bert-base-portuguese-cased') -> TypeError
I just installed the library on a TensorFlow environment (2.0.0-rc1) and there is no BertModel in transformers.
Is TFBertModel equivalent? If so, then I get the error TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType when loading the model with model = TFBertModel.from_pretrained('neuralmind/bert-base-portuguese-cased').
transformersversion: 2.4.1- Platform: Windows 10
- Python version: 3.7.6
- Tensorflow version (GPU?): 2.0.0-rc1 (it automatically uses GPU now)
- Using GPU in script?: No, just importing.
- Using distributed or parallel set-up in script?: No.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (4 by maintainers)
sometimes it works, sometimes it appears error
@daraksha-shirin you’re welcome! Glad that I could help!
Installing above packages solved this issue for me. Its working fine now. Thanks @nixon-nyx
This model is only available in PyTorch, Neuralmind has not provided a TensorFlow checkpoint for that model. You can see it on the page, as it has the tag
PyTorch, but noTensorFlowtag.You can still load it in TensorFlow, but you have to add the
from_ptflag:This might require you to have PyTorch installed to do the conversion.