60得票2回答
TensorFlow Keras模型和Estimator有什么区别?

Tensorflow Keras 模型和 Tensorflow Estimators 都能够训练神经网络模型并用于预测新数据。它们都是高级 API,位于低级核心 TensorFlow API 之上。那么我应该在什么时候使用其中一个而不是另一个呢?

42得票7回答
TensorFlow:logits和标签必须具有相同的第一维。

我是tensorflow的初学者,我想使用自己的数据(40x40大小的图像)调整MNIST教程https://www.tensorflow.org/tutorials/layers。这是我的模型函数:def cnn_model_fn(features, labels, mode): ...

40得票1回答
如何使用自定义tf.Estimator在tensorboard事件文件中创建仅一个图表的副本?

我正在使用自定义的 tf.Estimator 对象来训练神经网络。问题在于训练后的事件文件大小过大。 我已经通过使用 tf.Dataset.from_generator() 将数据集的一部分保存为常量来解决了这个问题。 但是,尽管如此,大小仍然相当大,在启动 tensorboard 时,我得到...

33得票8回答
Tensorflow 2.1.0中出现了“ModuleNotFoundError: No module named 'tensorflow_core.estimator'”错误。

使用tensorflow时,我遇到了以下错误信息ERROR:root:Internal Python error in the inspect module. Below is the traceback from this internal error.' File "<f...

22得票1回答
使用tf.Estimator创建的TensorFlow服务中的图形优化

背景: 我有一个简单的分类器,基于tf.estimator.DNNClassifier,它接受文本并输出意图标签上的概率。我能够训练并导出模型为可用状态,并使用TensorFlow Serving对其进行服务。问题在于,这个服务状态太大了(大约1GB),所以我想尝试一些TensorFlow图...

22得票4回答
如何在tf.estimator中使用早停法?

我正在使用TensorFlow 1.4中的tf.estimator和tf.estimator.train_and_evaluate功能非常出色,但我需要提前停止训练。如何添加此功能?我假设这里会有一些tf.train.SessionRunHook。我看到一个旧的contrib包含有Valida...

20得票3回答
TensorFlow Estimator ServingInputReceiver features vs receiver_tensors: 何时以及为什么使用?

在之前的问题中,探讨了serving_input_receiver_fn的目的和结构,在答案中: def serving_input_receiver_fn(): """For the sake of the example, let's assume your input to the...

19得票2回答
如何在使用`tensorflow.python.keras.estimator.model_to_estimator`将Keras模型转换为Estimator API时通知分类权重?

我在将一个基于Keras的模型转换为TensorFlow估计器API处理不平衡数据集时遇到了一些问题。 使用纯Keras API时,在model.fit方法中可以使用参数,但当使用tensorflow.python.keras.estimator.model_to_estimator将Ker...

17得票2回答
使用tf.estimator.Estimator框架进行迁移学习

我正在尝试对在imagenet上预训练的Inception-resnet v2模型进行迁移学习,使用自己的数据集和类别。我的原始代码库是tf.slim示例的修改版本,但我找不到它了,现在我正在尝试使用tf.estimator.*框架重新编写相同的代码。 然而,我遇到了一个问题:只加载来自预训...

16得票1回答
当一个JSON请求包含"_bytes"或"b64"时,Google Cloud ML Engine会做什么?

谷歌云文档(请参阅预测输入中的二进制数据)说明: 你的编码字符串必须格式化为一个名为b64的单个JSON对象键。以下Python示例使用base64库对原始JPEG数据缓冲区进行编码以创建一个实例:{"image_bytes":{"b64": base64.b64encode(jpeg...