简体   繁体   English

张量流模型制作器

[英]Tensor Flow Model Maker

I'm making an mobile app that uses TensorFlow Lite to perform text classification on tweets.我正在制作一个使用 TensorFlow Lite 对推文执行文本分类的移动应用程序。 I've done this successfully with the TensorFlow sample model but this model is trained on IMDB movie reviews and I want to have a custom model on device that is trained on tweets to increase accuracy.我已经使用 TensorFlow 示例模型成功地做到了这一点,但是这个模型是根据 IMDB 电影评论训练的,我希望在设备上有一个自定义模型,该模型针对推文进行训练以提高准确性。 I have training and test sets for this domain and am trying to create a custom model following this tutorial https://www.tensorflow.org/lite/tutorials/model_maker_text_classification我有这个领域的训练和测试集,我正在尝试按照本教程https://www.tensorflow.org/lite/tutorials/model_maker_text_classification创建自定义模型

I'm running into a pythion KeyError though and cant figure out why.我遇到一个pythion KeyError ,但并无法弄清楚为什么。 here is a screen shot这是一个屏幕截图

TFLite 模型制作工具

You can see on the right a sample of my csv, I have a label and Sentence column, using the TextClassifierDataLoader.您可以在右侧看到我的 csv 示例,我有一个labelSentence列,使用 TextClassifierDataLoader。 I don't understand why this key error is happening, I'm interpreting this as it can't find a column named "Sentence" but cleary it's there.我不明白为什么会发生这个关键错误,我将其解释为找不到名为“Sentence”的列,但很明显它就在那里。

Any ideas?有任何想法吗?

Seems to me that is_training is not an available argument in the class, so just take out that line/argument if you want it to compile (what it was supposed to do in the first place, I haven't looked into).在我看来 is_training 不是类中可用的参数,所以如果你想编译它,只需取出那行/参数(它应该首先做什么,我还没有研究过)。

https://github.com/tensorflow/examples/blob/1dc6978e2141e7a5efebcf6971b3afa9cb055679/tensorflow_examples/lite/model_maker/core/data_util/text_dataloader.py#L90 https://github.com/tensorflow/examples/blob/1dc6978e2141e7a5efebcf6971b3afa9cb055679/tensorflow_examples/lite/model_maker/core/data_util/text_dataloader.py#L90

问题是“句子”列的开头有一个空格

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM