簡體   English   中英

從 Tensorflow 使用 BERT model 時出錯

[英]Error with using BERT model from Tensorflow

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

但是,當我運行這些行時:

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

我收到以下錯誤:

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]

這兩個類完全相同:“tensorflow::lookup::LookupInterface”。 有人可以幫忙嗎? 謝謝你。

我在 GitHub 上發現了這個錯誤報告: https://github.com/tensorflow/text/issues/476

看來他們已經承認這是一個錯誤並正在嘗試修復它。

我在 windows 10 中也遇到了同樣的錯誤。然后我在 wsl2 ubuntu 18.04 中嘗試了它並且工作正常。 在wsl2 ubuntu中試試怎么樣

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM