《TensorFlow:实战Google深度学习框架》遇到问题



按照《TensorFlow:实战Google深度学习框架》一书学习的tensorflow,书中使用的是0.9.0版本,而我安装的是1.2.1,出现了一些问题:

  • W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn’tcompiled to use SSE4.1 instructions, but these are available on your machineand could speed up CPU computations.

  • W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn’tcompiled to use SSE4.2 instructions, but these are available on your machineand could speed up CPU computations.

  • W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn’tcompiled to use AVX instructions, but these are available on your machine andcould speed up CPU computations.

  • 大概就是这些警告,包裹SSE4.1 SSE4.2 AVX AVX2 FMA等等,这些warings的意思是说:你的机器上有这些指令集可以用,并且用了他们会加快你的CPU运行速度,但是你的TensorFlow在编译的时候并没有用到这些指令集。我的tensorflow在安装的时候采用的pip install指令,这种安装方式会存在这种问题。主要有两种解决方法,一种是修改警告信息的显示级别,使这种信息不再出现,另外一种就是自己重新编译安装tensorflow,在编译的时候使用这些指令集。可以不管,也可以参考http://blog.csdn.net/nicholas_wong/article/details/70215127
  • 3、错误“init() got an unexpected keyword argument ‘shape’”

    • 如果按照书上的例子来,因为这本书使用tensorflow是0.9.0版本,而在最新的tensorflow中有很多改动,文章最后会附上这些改动以供参考查看。这里的错误是因为新版tf.zeros_initializer和tf.ones_initializer后面需要加括号,将v = tf.get_variable(“v”,initializer=tf.zeros_initializer(shape=[1]))改为v = tf.get_variable(“v”,initializer=tf.zeros_initializer( )(shape=[1]))就可以了,下面的一样。
  • tf.global_variables_initializer的错误
    • WARNING:tensorflow:: initialize_all_variables (from tensorflow.python.ops.variables) is deprecated and will be removed after 2017-03-02.
      Instructions for updating:
      Use tf.global_variables_initializer instead.
      initialize_all_variables已被弃用,将在2017-03-02之后删除。
      说明更新:使用tf.global_variables_initializer代替。
      就把tf.initialize_all_variables()改为global_variables_initializer()就可以了




  • 原文链接:wqqGo的博客

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值