Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I am getting an error while running vocab builder. #16

Open
mshivasharan opened this issue Dec 1, 2020 · 2 comments
Open

I am getting an error while running vocab builder. #16

mshivasharan opened this issue Dec 1, 2020 · 2 comments

Comments

@mshivasharan
Copy link

mshivasharan commented Dec 1, 2020

I am getting an error while running vocab builder.

Code and files used for vocab bulider:
!git clone https://github.com/kwonmha/bert-vocab-builder.git
!wget https://github.com/LydiaXiaohongLi/Albert_Finetune_with_Pretrain_on_Custom_Corpus/raw/master/data_toy/restaurant_review_nopunct.txt
!python ./bert-vocab-builder/subword_builder.py --corpus_filepattern "restaurant_review_nopunct.txt" --output_filename "vocab.txt" --min_count 1

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

@kwonmha
Copy link
Owner

kwonmha commented Dec 4, 2020

Fixed issue 2.
tf.logging.INFO() should be tf.logging.info().

TY.

@Jennyyin20
Copy link

I am getting an error while running vocab builder.

Code and files used for vocab bulider: !git clone https://github.com/kwonmha/bert-vocab-builder.git !wget https://github.com/LydiaXiaohongLi/Albert_Finetune_with_Pretrain_on_Custom_Corpus/raw/master/data_toy/restaurant_review_nopunct.txt !python ./bert-vocab-builder/subword_builder.py --corpus_filepattern "restaurant_review_nopunct.txt" --output_filename "vocab.txt" --min_count 1

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

Hi Shiva, have you figured out how to solve issue 1?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants