question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

module 'tokenization' has no attribute 'FullTokenizer'

See original GitHub issue

I’m importing tokenization, have installed via pip, and cannot instantiate the tokenizer. I’m using the following code below and continue to get an error message of “module ‘tokenization’ has no attribute ‘FullTokenizer’”.

Anyone have a sense as to why?

tokenizer = tokenization.FullTokenizer(vocab_file=vocab_file, do_lower_case=do_lower_case)

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9

github_iconTop GitHub Comments

16reactions
nicsuzorcommented, May 12, 2019

If you installed from pip (I’m presuming pip install bert-tensorflow), try: from bert import tokenization

11reactions
celsofranssacommented, Feb 20, 2020

Maybe it can help someone using Tensorflow 2 and bert-for-tf2. There was a little change to create an instance of FullTokenizer:

from bert import bert_tokenization

...

tokenizer = bert_tokenization.FullTokenizer(
        vocab_file="resources/model/bert/bert_vocab.txt", 
        do_lower_case=True
    )



Read more comments on GitHub >

github_iconTop Results From Across the Web

I want to solve this error AttributeError: module 'tokenization ...
I want to solve this error AttributeError: module 'tokenization' has no attribute 'FullTokenizer' ; 26, in ; 'tokenization' has no attribute ' ...
Read more >
module 'tokenization' has no attribute 'FullTokenizer'_有梦想的 ...
AttributeError : module 'tokenization' has no attribute 'FullTokenizer'
Read more >
[Example code]-Can't import bert.tokenization
from bert.tokenization import FullTokenizer. I am getting this error: ModuleNotFoundError: No module named 'bert.tokenization'.
Read more >
Python Examples of bert.tokenization.FullTokenizer
You may also want to check out all available functions/classes of the module bert.tokenization , or try the search function . Example #1....
Read more >
Getting Error while adding new tokens in vocab - Beginners
__getattr__(self, name) 1183 if name in modules: 1184 return modules[name] -> 1185 raise AttributeError("'{}' object has no attribute ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found