Skip to content

Instantly share code, notes, and snippets.

@hsm207
Created October 1, 2019 23:50
Show Gist options
  • Save hsm207/143b6349ed1c92960be0dc1c6165d551 to your computer and use it in GitHub Desktop.
Save hsm207/143b6349ed1c92960be0dc1c6165d551 to your computer and use it in GitHub Desktop.
BERT_pretraining_share.ipynb
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mshivasharan
Copy link

I am getting an error while running vocab builder.

Issue 1: fixed replacing 'tf.flags' by ' tf.compat.v1.flags' (Version issue)
Traceback (most recent call last):
File "./bert-vocab-builder/subword_builder.py", line 37, in
tf.flags.DEFINE_string('output_filename', '/tmp/my.subword_text_encoder',
AttributeError: module 'tensorflow' has no attribute 'flags'

Issue 2:
The number of files to read : 1
Traceback (most recent call last):
File "./bert-vocab-builder/subword_builder.py", line 86, in
tf.app.run()
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/platform/app.py", line 125, in run
_sys.exit(main(argv))
File "./bert-vocab-builder/subword_builder.py", line 67, in main
split_on_newlines=FLAGS.split_on_newlines, additional_chars=FLAGS.additional_chars)
File "/content/bert-vocab-builder/tokenizer.py", line 191, in corpus_token_counts
split_on_newlines=split_on_newlines):
File "/content/bert-vocab-builder/tokenizer.py", line 139, in _read_filepattern
tf.logging.INFO("Start reading ", filename)
TypeError: 'int' object is not callable

Could any one help please me out on this issue? Thanks in advance

@hsm207
Copy link
Author

hsm207 commented Dec 1, 2020

@mshivasharan what version of tensorflow are you using?

@mshivasharan
Copy link

@hsm207 initially I was running with default tensorflow version in colab 2.x.x. Later I have changed to 1.11.

@hsm207
Copy link
Author

hsm207 commented Dec 2, 2020

@mshivasharan do you know where the bert-vocab-builder folder come from?

@mshivasharan
Copy link

mshivasharan commented Dec 2, 2020 via email

@hsm207
Copy link
Author

hsm207 commented Dec 2, 2020

I think it's best to raise an issue on that repo.

@mshivasharan
Copy link

mshivasharan commented Dec 2, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment