• Tensorflow所遇坑


    TensorFlow问题:

    1、FLAGS._parse_flags()报错AttributeError:_parse_flags

    解决:

    因为TensorFlow的版本问题了,TensorFlow版本升级后,它就无情的抛弃了FLAGS._parse_flags()这种用法,改成了用FLAGS.flag_values_dict()

    2、raise ValueError("Shapes %s and %s are incompatible" % (self, other))
          ValueError: Shapes (3, ?, 1, 1, 128) and () are incompatible

    解决:

    concated = tf.concat(1, [indices, sparse_labels])改为:

    concated= tf.concat([indices, sparse_labels], 1)

    3、WARNING:softmax_cross_entropy_with_logits (from tensorflow.python.ops.nn_ops) is deprecated and will be removed in a future version.

    Instructions for updating:

    Future major versions of TensorFlow will allow gradients to flow
    into the labels input on backprop by default.

    See tf.nn.softmax_cross_entropy_with_logits_v2.

    解决:

    将tf.nn.softmax_cross_entropy_with_logits改为:
    tf.nn.softmax_cross_entropy_with_logits_v2

    4.ValueError: Only call `softmax_cross_entropy_with_logits` with named arguments (labels=..., logits=..., ...)

    解决:

    将cross_entropy2=tf.reduce_sum(tf.nn.softmax_cross_entropy_with_logits_v2(logits, y_))改为:

    cross_entropy2=tf.reduce_sum(tf.nn.softmax_cross_entropy_with_logits_v2(labels=logits, logits=y_))

  • 相关阅读:
    微博回调接口
    vue获取微博授权URL
    生成微博授权URL接口
    微博账号注册
    微博三方登录原理讲解
    使用celery异步发送短信
    celery配置与基本使用
    友情链接
    Linux无线网络设置--wpa_supplicant的使用
    wpa_supplicant介绍与使用
  • 原文地址:https://www.cnblogs.com/gaofighting/p/10913569.html
Copyright © 2020-2023  润新知