tensorflow问题

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wang15061955806/article/details/82114235

1、slim模块作为一种轻量级的tensorflow库,使得模型的构建,训练,测试都变得更加简单

使用时需要import tf.contrib.slim as slim

参考:https://www.2cto.com/kf/201706/649266.html

2、tf.global_variables_initializer 问题

python fcn_32s_test_pascal.py时出现 _, serialized_example = reader.read(tfrecord_filenames_queue)

OutOfRangeError (see above for traceback): FIFOQueue '_0_input_producer' is closed and has insufficient elements (requested 1, current size 0)
         [[Node: ReaderReadV2 = ReaderReadV2[_device="/job:localhost/replica:0/task:0/device:CPU:0"](TFRecordReaderV2, input_producer)]]

网上说是需要将tf.global_variables_initializer转化为tf.local_variables_initializer,我尝试了下,就没有出现这个错误了。

3、Numpy操作函数

print((x + y)[..., newaxis])  #提高维度

imsize = 3
x, y = ogrid[:imsize, :imsize]  获取2个数组(3,1)(1,3)

猜你喜欢

转载自blog.csdn.net/wang15061955806/article/details/82114235