ycszen / tensorflowlaboratory Goto Github PK
View Code? Open in Web Editor NEWResearch about Tensorflow
Research about Tensorflow
你好,能说一下运行环境和运行步骤么?
受益匪浅!有几点问题,再请教下:
1、“关于Example Feature的相关定义和详细内容,我推荐去官网查看相关API”,请问有相关的API文档资料或网页吗?我一直没找到;
2、如果我们以TFRecords文件的形式读入图片数据进行模型训练获得模型后,新的图片数据,要对其进行分类,这时候这1张新的图片数据,需要以什么方式读入模型呢?有没有相应的脚本学习下呢?
3、“
之后我们可以在训练的时候这样使用
img, label = read_and_decode("train.tfrecords")
img_batch, label_batch = tf.train.shuffle_batch([img, label],
batch_size=30, capacity=2000,
min_after_dequeue=1000)
”
我猜测 img, label = read_and_decode("train.tfrecords") 让我们获得了图片及其类别标签(因为是多张图片,股都是链表的形式)
"
img_batch, label_batch = tf.train.shuffle_batch([img, label],
batch_size=30, capacity=2000,
min_after_dequeue=1000)
"
这句我猜测是将链表形式的图片数据及其标签,分成多个batch用于后续输入训练模型的语句,那么有个问题,batch_size=30意思是一个batch有多少个样本,capacity=2000和 min_after_dequeue=1000,分别是什么意思呢?
多谢指教哈!
这种网络你跑的效果怎么样呢?想参考一下
请问下有没有测过程序运行时GPU的使用效率?
我自己在用tfrecord和queue方式读写数据进行训练的时候,
如果:
with tf.device('/gpu:0'):
sess = tf.Session(config=tf.ConfigProto(allow_soft_placement=True))
的话,GPU只使用了一点,20%,大部分仍然用了CPU去算;
如果强制GPU的话
with tf.device('/gpu:0'):
sess = tf.Session()
会报如下错误,应该时某些任务不支持GPU上算导致,
InvalidArgumentError (see above for traceback): Cannot assign a device to node 'batch': Could not satisfy explicit device specification '/device:GPU:0' because no supported kernel for GPU devices is available.
Colocation Debug Info:
Colocation group had the following types and devices:
FIFOQueueV2: CPU
Switch: CPU
QueueDequeueManyV2: CPU
QueueSizeV2: CPU
QueueCloseV2: CPU
QueueEnqueueV2: CPU
[[Node: batch = QueueDequeueManyV2[component_types=[DT_FLOAT, DT_FLOAT], timeout_ms=-1, _device="/device:GPU:0"](batch/fifo_queue, batch/n)]];
是不是tf的queue方式不支持GPU的运算?
但如果不用tfrecord和queue,把所有图像都一次性读进来,然后用顺序训练,
只用
with tf.device('/gpu:0'):
sess = tf.Session()
时,GPU使用率超过85%,速度也比tfrecord和queue的方式快了几倍。
您好,使用的数据在在哪里下载?这个模型有没有原始论文,我想看一下
代码21行中for index, name in enumerate(classes):其中classes是什么,我是新手,请多多指教
ValueError: All shapes must be fully defined: [TensorShape([Dimension(None)]), TensorShape([Dimension(None)])]
首先感谢楼主分享代码!
有2个问题(tf 官方文档没看懂)
1,就是 x_train, y_train = read_and_decode("train_tfrecord", is_train=True)
返回多少数据(一个样本吗)?比方说一个400M的tf_records 文件, 而它后面跟的
tf.train.shuffle_batch([distorted_image, label], batch_size=25,num_threads=2, capacity=1000, min_after_dequeue=10)
每次训练时,这个函数是可以拿到一个batch 给计算图谱吗? 那训练时每次迭代如何保证数据是随机抽取的?
2,tf.train.start_queue_runners()和这个有什么关系
已经跑出tfrecords格式,接着用官网的train.py训练,报了下面的错误,请问是导出tfrecords格式有问题吗
tensorflow.python.framework.errors_impl.InvalidArgumentError: assertion failed: [Unable to decode bytes as JPEG, PNG, GIF, or BMP]
[[Node: case/cond/decode_image/cond_jpeg/cond_png/cond_gif/Assert_1/Assert = Assert[T=[DT_STRING], summarize=3, _device="/job:localhost/replica:0/task:0/device:CPU:0"](case/cond/decode_image/cond_jpeg/cond_png/cond_gif/is_bmp, case/cond/decode_image/cond_jpeg/cond_png/cond_gif/Assert_1/Assert/data_0)]]
ERROR:tensorflow:Exception in QueueRunner: Input to reshape is a tensor with 3072 values, but the requested shape has 12288
我用的是cifar10数据集。求大佬相助!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.