- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
将 1MM+ 行插入 wide and deep learning model抛出 ValueError:GraphDef 不能大于 2GB
:
Traceback (most recent call last):
File "search_click.py", line 207, in <module>
tf.app.run()
File "/usr/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 30, in run
sys.exit(main(sys.argv))
File "search_click.py", line 204, in main
train_and_eval()
File "search_click.py", line 181, in train_and_eval
m.fit(input_fn=lambda: input_fn(df_train), steps=FLAGS.train_steps)
File "/usr/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 182, in fit
monitors=monitors)
File "/usr/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/estimator.py", line 458, in _train_model
summary_writer=graph_actions.get_summary_writer(self._model_dir))
File "/usr/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/graph_actions.py", line 76, in get_summary_writer
graph=ops.get_default_graph())
File "/usr/lib/python2.7/site-packages/tensorflow/python/training/summary_io.py", line 113, in __init__
self.add_graph(graph=graph, graph_def=graph_def)
File "/usr/lib/python2.7/site-packages/tensorflow/python/training/summary_io.py", line 204, in add_graph
true_graph_def = graph.as_graph_def(add_shapes=True)
File "/usr/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2117, in as_graph_def
raise ValueError("GraphDef cannot be larger than 2GB.")
ValueError: GraphDef cannot be larger than 2GB.
我定义了与示例中相同的 input_fn
:
def input_fn(df):
"""Input builder function."""
# Creates a dictionary mapping from each continuous feature column name (k) to
# the values of that column stored in a constant Tensor.
continuous_cols = {k: tf.constant(df[k].values) for k in CONTINUOUS_COLUMNS}
# Creates a dictionary mapping from each categorical feature column name (k)
# to the values of that column stored in a tf.SparseTensor.
categorical_cols = {k: tf.SparseTensor(
indices=[[i, 0] for i in range(df[k].size)],
values=df[k].values,
shape=[df[k].size, 1])
for k in CATEGORICAL_COLUMNS}
# Merges the two dictionaries into one.
feature_cols = dict(continuous_cols)
feature_cols.update(categorical_cols)
# Converts the label column into a constant Tensor.
label = tf.constant(df[LABEL_COLUMN].values)
# Returns the feature columns and the label.
return feature_cols, label
是否有 tf.constant
和 tf.SparseTensor
的替代品允许批量插入并避免内存错误?
最佳答案
wide和deep的例子需要将数据集全部加载到内存中。如果你有大数据集,你可能需要 tf.decode_csv用于 csv 格式的输入。如果您的输入格式是自定义的,您应该创建一个 custom data reader .
关于python - Wide & Deep learning for large data 错误 : GraphDef cannot be larger than 2GB,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41439136/
我正在编写我的 servlet 程序并使用 jconsole 和 jmap 来监视其内存状态。我发现当我的程序运行时,内存池“PS Old Gen”变得越来越大,最后我的 servlet 无法响应任何
我正在执行从 tfs.visualstudio 到内部部署 2012 服务器的 TFS 集成迁移。我遇到了一个包含多个超过 1 MB 的二进制文件的特定变更集的问题,其中一些是 15-16 MB。 [
考虑一个带有内置整型常量的 Rust 程序 const N: u64和运行时整数值 x: u64 。我想匹配x这样值 x N分别。我的第一次尝试如下所示: const N: u64 = 3; mat
我不确定为什么,但我在使用 OG Debugger 时不断收到此警告并且 Facebook 没有加载正确的错误。它告诉我图像不够大,但图像是 404x404px,所以我不确定它的预期是什么,因为它符合
我在 PostgreSQL 中有一个包含一个数字列的表,我有一个给定的数字 x . 如果x在表格中,我想要所有数字 >= x . 如果x不在表格里,我要所有的数字> x和最大的数字 12 UNION
我想为我的用户提供显示某些 的可能性字体大小大于系统默认值的元素。 documentation仅提供该样式的编号。 我想显示带有 web-css“大”或“更大”值的文本,或者可能是 的 140%。原
您好,新年快乐, 我正在开发内核模块。有必要对某些参数进行数值计算才能正确设置设备。该函数工作完美,但 gcc 编译器(我正在使用 kbuild)给了我警告: warning: the frame s
我正在解决一些关于图表的问题。它需要存储 N 个节点的权重(N。如果一个节点连接到几乎所有其他节点,这是不好的,如果连接到几个节点,则便宜 删除边对于大社区来说也是昂贵的(在最坏的线性时间内,一个
我正在尝试实现一个读取图像宽度和高度的脚本,如果图像高度大于 600,则将 html div 的高度设置为 600。如果高度小于 600,则 div 的高度将是图像的高度。 这是我一直在尝试的。 Ja
我想用 while 循环测量计算时间。 我正在使用 C99 版本进行编程。 我的代码如下: struct timeval startingTime,endingTime; gettimeofday(&
以下算法返回数组中前一个较大的元素。它来自 these 的第 11 页笔记。 // Input: An array of numeric values a[1..n] // Returns: An a
我需要将科学信息存储在数据库 (sql server) 中。在“小于”、“大于”是信息的一部分的数据库中存储值的最佳方式是什么。 例子: 患者编号:123变异率:<3% 患者编号:999突变率:3%
在 Excel 中,是否有一个 native 函数可以返回两个值中较大的一个?我希望避免使用 IF 函数。如果值得的话,我正在使用 Excel 2010 Beta。 例如: GTR(66,24) 将返
我正在开发一个项目,需要通过 RMI 网络显示一些加密解密。我为此使用 RSA 系统。解密时,我的代码出现以下错误: javax.crypto.BadPaddingException: Message
我已从 Visual Studio 多次部署到 Azure 网站,但从几周前开始我无法再进行部署。我一遍又一遍地收到此错误 Web deployment task failed. (Error des
假设我在 h1 元素中有一个标题(任何元素都可以)。它的内容是动态的(不知道标题的长度)。它应该显示在一行中。 h1 在一个大小有限的 DIV(我们称之为容器)中。 我怎么知道元素 (h1) 是否溢出
我在基于此 real-world example 的小型项目中使用 Redux/sagas 工作流,但这些逻辑并不那么复杂。我应该如何使用更全面的 API(即 Reddit 的 API)而不会使事情变
我收到以下错误 - 显然是在保存模型时 Step = 1799 | Tensorflow Accuracy = 1.0 Step = 1799 | My Accuracy = 0.036335
我已经安装了mysql服务器5.1。当我尝试插入一个大文件时,我的 MySQL 数据库中的 BLOB 字段出现问题。有人有什么建议吗? 提前非常感谢 最佳答案 如何解决此问题: 更改 max_allo
我有以下代码 Can you click me? 目标是我可以点击“你能点击我吗”框并转到 google 并在包含 div 的任何其他地方
我是一名优秀的程序员,十分优秀!