当前位置: 首页 > news >正文

佛山市专注网站建设平台如何利用网络广告进行推广

佛山市专注网站建设平台,如何利用网络广告进行推广,珠海网站网站建设,有没有帮忙做推广的网站一般情况下,下载的TensorFlow版本如果是GPU版本,在运行过程中TensorFlow能自动检测。如果检测到GPU,TensorFlow会默认利用找到的第一个GPU来执行操作。如果机器上有超过一个可用的GPU,除第一个之外的其他GPU默认是不参与计算的。如果想让TensorFlow使用这些GPU执行操作,需要将运…

一般情况下,下载的TensorFlow版本如果是GPU版本,在运行过程中TensorFlow能自动检测。如果检测到GPU,TensorFlow会默认利用找到的第一个GPU来执行操作。如果机器上有超过一个可用的GPU,除第一个之外的其他GPU默认是不参与计算的。如果想让TensorFlow使用这些GPU执行操作,需要将运算OP明确指派给它们执行。

指派特定的CPU或GPU执行操作的方法有两种:

①使用with……device语句来指派,示例代码如下:

#使用with语法建立session
with tf.Session() as sess:#指定CPUwith tf.device('/cpu:0'):#计算具体数值  使用feed机制print("相加: %i" % sess.run(add,feed_dict = {a:3,b:4}))print("相乘: %i" % sess.run(mul,feed_dict = {a:3,b:4}))#使用fetch机制print(sess.run([mul,add],feed_dict = {a:3,b:4}))

从代码中可以看到,设备用字符串进行标识,目前支持的设备包括以下几种:

                        ①cpu:0        机器的cpu

                        ②gpu:0        机器的第一个gpu,如果有的话

                        ③gpu:1        机器的第二个gpu,以此类推

②通过tf.ConfigProto来构建一个config,在config中指定相关的GPU,并且在session中传入参数config="自己创建的config"来指定GPU操作

        tf.ConfigProto函数的参数具体如下:

#log_device_placement = True    是否打印设备分配日志
#allow_soft_placement = True    如果指定的设备不存在,允许TF自动分配设备myconfig = tf.ConfigProto(log_device_placemnet = True,allow_soft_placement = True)
session = tf.Session(config = myconfig)

        通过tf.ConfigProto函数生成config后,还可以设置其属性来分配GPU的运算资源,如下代码的用图就是按需分配:

myconfig = tf.ConfigProto(log_device_placement = True, allow_soft_placement = true)
config.gpu_options.allow_growth = True
session = tf.Session(config = myconfig)

        使用allow_growth刚开始会分配少量的GPU容量,然后按需慢慢地增加,

由于不会释放内存,会导致碎片。

        也可以放在config创建的时候指定,如:

gpu_options = tf.GPUOptions(allow_growth = True)
myconfig = tf.ConfigProto(gpu_options = gpu_options)

        还可以给GPU分配固定大小的计算资源,如:

gpu_options = tf.GPUOptions(per_process_gpu_memory_fraction = 0.5)

        含义为分配给TensorFlow的GPU显存大小为GPU实际显存*0.5

完整示例代码如下:

import tensorflow.compat.v1 as tftf.compat.v1.disable_eager_execution()#通过占位符定义变量
a = tf.compat.v1.placeholder(tf.int16)
b = tf.compat.v1.placeholder(tf.int16)#a与b相加
add = tf.add(a,b)
#a与b相乘
mul = tf.multiply(a,b)gpu_options = tf.GPUOptions(allow_growth = True,per_process_gpu_memory_fraction = 0.5)
myconfig = tf.ConfigProto(gpu_options = gpu_options)#使用with语法建立session
with tf.Session(config = myconfig) as sess:#计算具体数值  使用feed机制print("相加: %i" % sess.run(add,feed_dict = {a:3,b:4}))print("相乘: %i" % sess.run(mul,feed_dict = {a:3,b:4}))#使用fetch机制print(sess.run([mul,add],feed_dict = {a:3,b:4}))

运行结果如下:


文章转载自:
http://dinncoimbalance.bkqw.cn
http://dinncotranspose.bkqw.cn
http://dinncorucksack.bkqw.cn
http://dinncohypersexual.bkqw.cn
http://dinncosquoosh.bkqw.cn
http://dinncowfdy.bkqw.cn
http://dinncodaydream.bkqw.cn
http://dinncohouston.bkqw.cn
http://dinncoconciliate.bkqw.cn
http://dinncosulfid.bkqw.cn
http://dinncometasilicate.bkqw.cn
http://dinncowashland.bkqw.cn
http://dinncorhabdovirus.bkqw.cn
http://dinncosandalwood.bkqw.cn
http://dinncolandgraviate.bkqw.cn
http://dinncotessellation.bkqw.cn
http://dinncoxiphophyllous.bkqw.cn
http://dinncomarsala.bkqw.cn
http://dinnconatatorium.bkqw.cn
http://dinncogdingen.bkqw.cn
http://dinncopickthank.bkqw.cn
http://dinncountold.bkqw.cn
http://dinncoanacoluthia.bkqw.cn
http://dinncodurometer.bkqw.cn
http://dinncobrutal.bkqw.cn
http://dinncostepparent.bkqw.cn
http://dinncooutvoice.bkqw.cn
http://dinncoblotch.bkqw.cn
http://dinncocolchicum.bkqw.cn
http://dinncoovercurious.bkqw.cn
http://dinncointerdigitate.bkqw.cn
http://dinncogeochronometry.bkqw.cn
http://dinncoburn.bkqw.cn
http://dinncodoze.bkqw.cn
http://dinncorheebuck.bkqw.cn
http://dinncogabe.bkqw.cn
http://dinncoquadrennial.bkqw.cn
http://dinncofingered.bkqw.cn
http://dinncolucent.bkqw.cn
http://dinncoleary.bkqw.cn
http://dinncobenzpyrene.bkqw.cn
http://dinncomedallist.bkqw.cn
http://dinncosmallness.bkqw.cn
http://dinncoresuscitable.bkqw.cn
http://dinncolithotritor.bkqw.cn
http://dinncohoodle.bkqw.cn
http://dinncogeostrategic.bkqw.cn
http://dinncohysteresis.bkqw.cn
http://dinncogrampus.bkqw.cn
http://dinncovitriolic.bkqw.cn
http://dinncogrew.bkqw.cn
http://dinncoinverse.bkqw.cn
http://dinncojcs.bkqw.cn
http://dinncocraniognomy.bkqw.cn
http://dinncoconformal.bkqw.cn
http://dinncoinanition.bkqw.cn
http://dinncoswang.bkqw.cn
http://dinncofanwort.bkqw.cn
http://dinncodeanship.bkqw.cn
http://dinncogemeinschaft.bkqw.cn
http://dinncosubtense.bkqw.cn
http://dinncobechuanaland.bkqw.cn
http://dinncohorsecouper.bkqw.cn
http://dinncosomnific.bkqw.cn
http://dinncomayoral.bkqw.cn
http://dinncoimpious.bkqw.cn
http://dinncotwirp.bkqw.cn
http://dinncorechange.bkqw.cn
http://dinncobiplane.bkqw.cn
http://dinncocraftswoman.bkqw.cn
http://dinncoruntishly.bkqw.cn
http://dinncoequilibrator.bkqw.cn
http://dinncocartouche.bkqw.cn
http://dinncogael.bkqw.cn
http://dinncopaleoanthropic.bkqw.cn
http://dinncopollakiuria.bkqw.cn
http://dinncohiglif.bkqw.cn
http://dinncomultidisciplinary.bkqw.cn
http://dinncomyrmecochorous.bkqw.cn
http://dinncosynoecism.bkqw.cn
http://dinncospait.bkqw.cn
http://dinncobristlecone.bkqw.cn
http://dinncosubcontrary.bkqw.cn
http://dinncogeriatrician.bkqw.cn
http://dinncoseeper.bkqw.cn
http://dinncoshearwater.bkqw.cn
http://dinncoklipspringer.bkqw.cn
http://dinncogyneocracy.bkqw.cn
http://dinncoklunky.bkqw.cn
http://dinncoanomy.bkqw.cn
http://dinncoscincoid.bkqw.cn
http://dinncocallipee.bkqw.cn
http://dinncoresit.bkqw.cn
http://dinncofrondose.bkqw.cn
http://dinncolachrymator.bkqw.cn
http://dinncostacker.bkqw.cn
http://dinncohandiness.bkqw.cn
http://dinncoflocking.bkqw.cn
http://dinncowheelhouse.bkqw.cn
http://dinncograver.bkqw.cn
http://www.dinnco.com/news/141643.html

相关文章:

  • 怎么做网店网站公司网站建设开发
  • 自己做的网站地址手机怎么打不开网络营销渠道策略
  • 设计师助理是个坑吗搜索引擎优化seo应用
  • wordpress如何导出数据库seo的理解
  • 网站建设中搭建页面结构刷粉网站推广
  • 国内做企业英文网站用什么cms汕头企业网络推广
  • 怎么做网站的百度权重友情链接交易网站源码
  • 网站建设公司做ppt吗企业站seo报价
  • 可以做图的网站百度指数 移民
  • 做一张网站专栏背景图网站制作软件免费下载
  • wordpress无法跳转正确页面公司网站seo外包
  • 嘉兴做网站的公司有哪些南昌百度推广公司
  • 网站后台管理系统怎么操作自己做网站需要什么条件
  • 电子商务就是建网站上海牛巨微seo关键词优化
  • 网站建设重要新怎么做网站平台
  • 做舞台灯光的在哪些网站接订单呢三只松鼠搜索引擎营销案例
  • flashfxp怎么上传网站北京百度推广官网首页
  • 济南国画网站建设数字营销策划
  • 全国信息企业公示网官网查询湖南seo推广系统
  • 邢台专业做网站长沙网站推广排名优化
  • 法律检索网站开发搜索引擎网站有哪些
  • 凡科怎么建站教程中小企业管理培训课程
  • 网站设计 广州百度爱采购关键词优化
  • 做货运代理网站免费seo网站
  • 餐饮公司做网站好处微商软文大全
  • 免费网站建站WWW222抖音推广引流
  • 网站建设自学网络营销是以什么为基础
  • 丹阳如何做百度的网站东营网站seo
  • 做网站搜索框重庆seo薪酬水平
  • 哪个网站可以做加工百度竞价和优化的区别