简体   繁体   English

在 tflite model maker 上使用 mnist 数据集

[英]Using mnist dataset on tflite model maker

I would like to try tflite model maker which provides pretrained machine learning models for softwares.我想尝试为软件提供预训练机器学习模型的 tflite model 制造商。 I'm new at it and i'd like to set a tflite model with "mnist" dataset for image classification api.我是新手,我想为图像分类 api 设置一个带有“mnist”数据集的 tflite model。 I took my data from keras.datasets but i can't import it with "DataLoader" which is in tflite.我从 keras.datasets 中获取了我的数据,但我无法使用 tflite 中的“DataLoader”导入它。

My question: Is there any way to use array data on image_classifier?我的问题:有没有办法在 image_classifier 上使用数组数据?

my codes:我的代码:

from tflite_model_maker import image_classifier
from tflite_model_maker.image_classifier import DataLoader
from sklearn.datasets import load_digits

data = load_digits()

# Load input data specific to an on-device ML app.
train_data, test_data = data.split(0.9)

# Customize the TensorFlow model.
model = image_classifier.create(train_data)

# Evaluate the model.
loss, accuracy = model.evaluate(test_data)

Error i encountered:我遇到的错误:

KeyError: 'split'

During handling of the above exception, another exception occurred:

AttributeError                            Traceback (most recent call last)
1 frames
/usr/local/lib/python3.7/dist-packages/sklearn/utils/__init__.py in __getattr__(self, key)
    117             return self[key]
    118         except KeyError:
--> 119             raise AttributeError(key)
    120 
    121     def __setstate__(self, state):

AttributeError: split

load_digits() object has no attribute split, use train_test_split from sklearn. load_digits() object 没有属性拆分,使用sklearn中的 train_test_split。 For example:例如:

train_data, test_data = train_test_split(data, target, test_size=0.01)

暂无
暂无

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

相关问题 TFLite model maker 自定义 object 检测器训练使用 tfrecord - TFLite model maker custom object detector training using tfrecord 使用MNIST数据集Pytorch训练SqueezeNet模型 - Train SqueezeNet model using MNIST dataset Pytorch 我的DNN模型使用张量流比较MNIST数据集没有取得进展 - My DNN model to compare MNIST dataset using tensorflow not making progress 具有Fashion MNIST数据集的TensorFlow模型 - TensorFlow Model with Fashion MNIST dataset tflite-model-maker 自定义数据集 (pascal voc) 问题 - ValueError: The size of the train_data (0) could not be less than the batch_size (1) - tflite-model-maker custom dataset (pascal voc) problem - ValueError: The size of the train_data (0) couldn't be smaller than the batch_size (1) 数据集 TensorFlow Lite Model Maker 对象检测 - Dataset TensorFlow Lite Model Maker object detection 使用使用时尚 mnist 数据集训练的 model 预测来自谷歌图像(包)的图像的 class - Predicting a class of a an image from google images(bag) using a model that is trained using fashion mnist dataset 如何使用MNIST数据集实现超参数 - How to implement a Hyperparameter using a MNIST dataset 使用 TensorFlow 查找 MNIST 数据集的精度和召回率 - Finding precision and recall for MNIST dataset using TensorFlow 是否可以通过 TFLite Model Maker 创建多类文本分类器 Tensorflow Lite model? - Is it possible to create a multi-class Text Classifier Tensorflow Lite model by TFLite Model Maker?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM