zoukankan      html  css  js  c++  java
  • tensorflow o. 到 tensorflow 1. 部分改变

    一下内容为笔者实际应用中遇到的问题,可能(必须)不全,后面会持续更新。

    (1) tf.nn.run_cell   改为   tf.contrib.rnn

    (2) tf.reduce_mean   改为   tf.reduce.sum

    (3) tf.nn.seq2seq.sequence_loss_by_example    改为

         tf.contrib.legacy_seq2seq.sequence_loss_by_example

    (4) tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logit(y,y_))   改为

         tf.reduce_sum(tf.nn.softmax_cross_entropy_with_logit(logits=logits,labels=y_))

    (5) tf.train.SummaryWriter   改为:   tf.summary.FileWriter

    (6) tf.merge_all_summary()   改为:   tf.summary.merge_all()

    (7) tf.histogram_summary()   改为:   tf.summary.histogram()

    (8) tf.scalar_summary()   改为:   tf.summary.scalar()

    (9) tf.image_summary()   改为:   tf.summary.image()

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

    (11) TypeError: Using a `tf.Tensor` as a Python `bool` is not allowed. Use `if t is not None:` instead of `if t:` to test if a tensor is defined, and use TensorFlow ops such as tf.cond to execute subgraphs conditioned on the value of a tensor.

    if grad:    改为     if grad is not None:

  • 相关阅读:
    VueJS
    Nacos 微服务注册发现配置中心
    精简自己20%的代码(异常的处理)
    lazarus 检测内存泄漏
    winsocket练习一 阻塞与select模型
    js原型链解析
    块元素 父子外边距现象
    行高的继承
    行内元素(文字)垂直平居中
    本地文件播放
  • 原文地址:https://www.cnblogs.com/Climbing-Snail/p/6733342.html
Copyright © 2011-2022 走看看