随笔分类 -  TensorFlow

摘要:tensorflow中的concat方法(tf.concat)可以进行两个向量的拼接,共有两个参数: 1、要拼接的两个向量; 2、要拼接的维度,从0开始。 1 t1 = [[1, 2, 3], [4, 5, 6]] 2 t2 = [[7, 8, 9], [10, 11, 12]] 3 tf.conc 阅读全文
posted @ 2021-03-08 15:01 一帆小白 阅读(1921) 评论(0) 推荐(0)
摘要:下面的代码是生成一个每个图片大小是227*227*1的tfrecord文件,label是这个类别的英文名。 原图片是256*256*3RGB型的.jpg文件,在制作数据集的时候由于对图片的颜色没有要求,所以为了节省空间,进行了灰度化处理。 import tensorflow as tf import 阅读全文
posted @ 2019-12-01 10:30 一帆小白 阅读(246) 评论(0) 推荐(0)
摘要:from captcha.image import ImageCaptcha import random import sys import numpy as np from PIL import Image number = ['0', '1', '2', '3', '4', '5', '6', 阅读全文
posted @ 2019-11-22 21:45 一帆小白 阅读(157) 评论(0) 推荐(0)
摘要:一、Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 解决方法: 二、FutureWarning: Passing (type, 1) or '1type' as a sy 阅读全文
posted @ 2019-11-21 21:49 一帆小白 阅读(2006) 评论(0) 推荐(0)
摘要:def fully_connected( inputs, # 输入 num_outputs, # 本层输出的数量 activation_fn=tf.nn.relu, # 本层的激活函数(None则默认为线性) normalizer_fn=None, # 正则化函数(用来替代偏置[biases],如果 阅读全文
posted @ 2019-10-21 11:30 一帆小白 阅读(360) 评论(0) 推荐(0)