Error with using BERT model from Tensorflow

Viewed 1338

I have tried to follow Tensorflow instructions to use BERT model: (https://www.tensorflow.org/tutorials/text/classify_text_with_bert)

However, when I run these lines:

text_test = ['this is such an amazing movie!']
text_preprocessed = bert_preprocess_model(text_test)

I got the below error:

InvalidArgumentError:  Trying to access resource using the wrong type. Expected class tensorflow::lookup::LookupInterface got class tensorflow::lookup::LookupInterface
     [[{{node StatefulPartitionedCall/StatefulPartitionedCall/bert_tokenizer/StatefulPartitionedCall/WordpieceTokenizeWithOffsets/WordpieceTokenizeWithOffsets/WordpieceTokenizeWithOffsets}}]] [Op:__inference_restored_function_body_72474]

The two classes are exactly the same: "tensorflow::lookup::LookupInterface". Could anyone help with this? Thank you.

2 Answers

I also got same error in windows 10. Then I tried it in wsl2 ubuntu 18.04 and works fine. How about try it in wsl2 ubuntu

Related