tensorflow版本不同的问题

暂时整理了遇到的由于tensorflow版本不同API更改后导致的一些报错:

  1. AttributeError:‘module’ object has no attribute ‘mul’
    tf.mul()改成:tf.multiply()
  2. AttributeError:‘module’ object has no attribute ‘sub’
    tf.sub()改成:tf.subtract()
  3. AttributeError:‘module’ object has no attribute ‘neg’
    tf.neg()改成:tf.negative()
  4. AttributeError:‘module’ object has no attribute ‘select’
    tf.select()改成:tf.where()
  5. AttributeError: ‘module’ object has no attribute ‘scalar_summary’
    tf.scalar_summary() 改成:tf.summary.scalar()
  6. AttributeError: ‘module’ object has no attribute ‘histogram_summary’
    tf.histogram_summary() 改成:tf.summary.histogram()
  7. AttributeError: ‘module’ object has no attribute ‘merge_all_summaries’
    tf.merge_all_summaries() 改成:tf.summary.merge_all()
  8. AttributeError: ‘module’ object has no attribute ‘SummaryWriter’
    tf.train.SummaryWriter() 改成:tf.summary.FileWriter()
    后续遇到类似的问题会持续更新。

你可能感兴趣的:(佩奇遇到的迷之问题)