• 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_))

  • 相关阅读:
    kubernetes部署Ingress Controller创建证书
    污点和容忍度
    Kubernetes部署coredns
    python中私有属性和私有方法
    类的约束
    reactjs 入门
    angularjs ngTable -Custom filter template-calendar
    sql 中条件in参数问题
    详解 nginx location ~ .*.(js|css)?$ 什么意思?
    CentOS 7.2.1511编译安装Nginx1.10.1+MySQL5.7.14+PHP7.0.11
  • 原文地址:https://www.cnblogs.com/gaofighting/p/10913569.html
Copyright © 2020-2023  润新知