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

(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:

相关文章:

  • 2021-08-20
  • 2022-01-27
  • 2021-08-13
  • 2021-09-23
  • 2021-05-27
  • 2021-08-05
  • 2022-01-18
  • 2022-02-10
猜你喜欢
  • 2021-11-10
  • 2021-10-20
  • 2021-09-11
  • 2021-07-12
  • 2021-08-17
  • 2021-07-12
  • 2022-02-13
相关资源
相似解决方案