![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
tensorflow
嗨皮lemon
这个作者很懒,什么都没留下…
展开
-
tensorflow-saver保存读取
1.保存变量到文件中 import tensorflow as tf import numpy as np # 当保存变量的时候记得他们设置相同的类型,否则报错 W = tf.Variable([[1,2,3],[3,4,5]], dtype=tf.float32, name='weights') b = tf.Variable([[1,2,3]], dtype=tf.float32, name...原创 2018-08-14 14:29:12 · 199 阅读 · 0 评论 -
tensorflow中session的两种打开模式
import tensorflow as tf matrix1 = tf.constant([[3, 3]])#一行两列的矩阵 matrix2 = tf.constant([[2], [2]])#2行1列的矩阵 #tensorflow矩阵相乘 product = tf.matmul(matrix1, matrix2) #numpy中矩阵相乘的形式...原创 2018-08-16 10:17:33 · 1745 阅读 · 0 评论 -
tensorflow学习--feed_dictionary传入值placeholder
使用placeholder就默认了你在后期sess.run()里面给他输入值,feed_dict={}是字典的形式 可以理解为placeholder与feed_dict={}是绑定的 import tensorflow as tf #需要给定数据格式,tensorflow大部分只能处理float32的格式 input1 = tf.placeholder(tf.float32) input2...原创 2018-08-13 16:09:06 · 599 阅读 · 0 评论