处理错误:Instructions for updating: To construct input pipelines, use the `tf.data` module.

首先找到对应的错误代码:
C:\Users\admin\PycharmProjects\untitled3\mnist_generateds.py:56: string_input_producer (from tensorflow.python.training.input) is deprecated and will be removed in a future version.
Instructions for updating:
Queue-based input pipelines have been replaced by tf.data. Use tf.data.Dataset.from_tensor_slices(string_tensor).shuffle(tf.shape(input_tensor, out_type=tf.int64)[0]).repeat(num_epochs). If shuffle=False, omit the .shuffle(...).
大概说的是:
原来数据读取方式被弃用了,要求用新的方法tf.data替代
原因是:
源代码时代的TensorFlow的版本与本次实验环境的版本不同
更新了 Dataset API
新的Dataset API同时支持从内存和硬盘的读取
修改方法:
修改读取数据的方法
①#创建来自于tensors的dataset
dataset1=tf.data.Dataset.from_tensor_slices
②#创建来自于文件的dataset
dataset1= tf.contrib.data.TextLineDataset(file)
如果有map,batch,shuffle,repeat这些操作也要在自己补充上去

如果想深入学习Dataset API的话可以点击下面的链接:一篇关于Dataset API的教程

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值