莫烦tensorflow(2)-Session
import os
os.environ['TF_CPP_MIN_LOG_LEVEL']='2'
import tensorflow as tf
matrix1 = tf.constant([[3,3]])
matrix2 = tf.constant([[2],[2]])
protuct = tf.matmul(matrix1,matrix2)
# sess = tf.Session()
# result = sess.run(protuct)
# print(result)
# sess.close()
with tf.Session() as sess:
result = sess.run(protuct)
print(result)
莫烦tensorflow(2)-Session的更多相关文章
- 莫烦tensorflow(9)-Save&Restore
import tensorflow as tfimport numpy as np ##save to file#rember to define the same dtype and shape w ...
- 莫烦tensorflow(8)-CNN
import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_data#number 1 to 10 dat ...
- 莫烦tensorflow(7)-mnist
import tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_data#number 1 to 10 dat ...
- 莫烦tensorflow(6)-tensorboard
import tensorflow as tfimport numpy as np def add_layer(inputs,in_size,out_size,n_layer,activation_f ...
- 莫烦tensorflow(5)-训练二次函数模型并用matplotlib可视化
import tensorflow as tfimport numpy as npimport matplotlib.pyplot as plt def add_layer(inputs,in_siz ...
- 莫烦tensorflow(4)-placeholder
import tensorflow as tf input1 = tf.placeholder(tf.float32)input2 = tf.placeholder(tf.float32) outpu ...
- 莫烦tensorflow(3)-Variable
import tensorflow as tf state = tf.Variable(0,name='counter') one = tf.constant(1) new_value = tf.ad ...
- 莫烦tensorflow(1)-训练线性函数模型
import tensorflow as tfimport numpy as np #create datax_data = np.random.rand(100).astype(np.float32 ...
- tensorflow学习笔记-bili莫烦
bilibili莫烦tensorflow视频教程学习笔记 1.初次使用Tensorflow实现一元线性回归 # 屏蔽警告 import os os.environ[' import numpy as ...
随机推荐
- 函数使用十二:BAPI_MATERIAL_BOM_GROUP_CREATE(CS61)
REPORT ZSM_CREATE_SIMPLEBOM.* This code will create a material BoM for the material* MAINMATERIAL wi ...
- PostgreSQL&PostGIS完全安装
检查PostGIS.PostgreSQL.GEOS.GDAL.PROJ等各软件的版本依赖关系 http://trac.osgeo.org/postgis/wiki/UsersWikiPostgreSQ ...
- 一、SQL应用(工作中遇到的根据表的某列的值不同,采用的不同列关联表)
一.工作总结: 今天工作中遇到了这样一个需求,具体是根据某张表的某一列值得不同,进行不同关联操作.起初自己的想法是采用UNION操作,把两种情况连接起来,但是会出现一个问题,当进行动态传值SQL拼接的 ...
- 浏览器行为模拟之requests、selenium模块
requests模块 前言: 通常我们利用Python写一些WEB程序.webAPI部署在服务端,让客户端request,我们作为服务器端response数据: 但也可以反主为客利用Python的re ...
- summary_20th,Nov 2018
一. 常量: 相对于变量,不改变的量 规定常量名全部大写(实际还是变量) 二:数值的运算符: 1. 算术运算符 + 和, - 减, *乘, / 除(浮点数结果) // 取整, ...
- for循环跳转语句(break、continue)
跳转语句用于实现循环执行过程中程序流程的跳转,在Java中的跳转语句有break语句和continue语句.接下来分别进行详细地讲解. 1. break语句 在switch条件语句和循环语句中都可以使 ...
- secFox setting
secFox setting 1● load file 2● install 3● use
- rnnlib依赖ubuntu环境配置
rnnlib help http://sourceforge.net/apps/mediawiki/rnnl/index.php?title=Main_Page boost: http://blog. ...
- OO作业总结报告3
规格化设计的发展史 下面部分来源:https://www.cnblogs.com/eggert/p/9098446.html: 随着计算机硬件的飞速发展,以及应用复杂度越来越高,软件规模越来越大,原有 ...
- 用flask Flask-RESTful,实现RESTful API
简介: 自从Roy Fielding博士在2000年他的博士论文中提出REST(Representational State Transfer)风格的软件架构模式后,REST就基本上迅速取代了复杂而笨 ...