Separius / BERT-keras

Keras implementation of BERT with pre-trained weights
GNU General Public License v3.0
815 stars 197 forks source link

Support for Colab & tpu #5

Closed HighCWu closed 5 years ago

HighCWu commented 5 years ago

Change keras to tf.keras for tpu using. Rename directory 'google' to 'google_bert' for namespace conflict reason while using Colab. I create a colab ipynb file based on your 'tutorial.ipynb' for tpu support. Some variables are uninitialized after 'keras_to_tpu_model', so I initialized them. I don't know if it's right. If yes, you can try to add my colab code to this repo. Here is the colab code: https://colab.research.google.com/gist/HighCWu/3a02dc497593f8bbe4785e63be99c0c3/bert-keras-tutorial.ipynb

HighCWu commented 5 years ago

In my mind, it seems tf.keras doesn't have the theano backend. I don't know the resolution at present.

Separius commented 5 years ago

Wow, thanks man, I checked your code and it seems legit; thanks for your contribution!

HighCWu commented 5 years ago

@Separius if it's OK, I think you can add a link to the Colab tutorial code in the README and other programmers can get the right way to use free TPU.

Separius commented 5 years ago

sure, I will add the link in a moment

On Mon, Nov 26, 2018 at 6:27 PM hcWu notifications@github.com wrote:

@Separius https://github.com/Separius if it's OK, I think you can add a link to the Colab tutorial code in the README and other programmers can get the right way to use free TPU.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Separius/BERT-keras/pull/5#issuecomment-441667783, or mute the thread https://github.com/notifications/unsubscribe-auth/AAfsCbBme_tDYKmLltlJV3STS9Oxb9Adks5uzAFqgaJpZM4Yy-Rc .