neuralmind-ai / portuguese-bert

Portuguese pre-trained BERT models
Other
802 stars 124 forks source link

Failed to load tensorflow checkpoint #7

Open domus123 opened 4 years ago

domus123 commented 4 years ago

Hello, I'm having an issue trying to load model (base) on tensorflow 2.0

When trying to load checkpoints from different devices (e.g cpu from gpu) in tensorflow usually we use the following:

_tf.compat.v1.train.import_meta_graph(metadata_path, clear_devices=True)_

That makes possible for loading graphs on other devices (in this case, should be able to load on CPU).

I'm getting the following error while loading the model on tensorflow

image

The code that generate this error: image

Can you specifies the specs that were used during training? Any ideas on what's happening?

fabiocapsouza commented 4 years ago

Hi domus123,

The models were trained on TPU v3-8 using TF 1.14 and the code from original BERT repository: https://github.com/google-research/bert/blob/master/run_pretraining.py.

Unfortunately I'm not a TF user so I can really help you with this problem. Did you manage to solve it?

israellaurensi commented 4 years ago

Any update on this? I'm having the same issue trying to convert the metadata to .pb

domus123 commented 4 years ago

Hi, wasn't able to convert here. Seem's that tensorflow can convert GPU to CPU, but I don't have knowledge about TPU's