暂时整理了遇到的由于tensorflow版本不同API更改后导致的一些报错:
- AttributeError:‘module’ object has no attribute ‘mul’
tf.mul()改成:tf.multiply() - AttributeError:‘module’ object has no attribute ‘sub’
tf.sub()改成:tf.subtract() - AttributeError:‘module’ object has no attribute ‘neg’
tf.neg()改成:tf.negative() - AttributeError:‘module’ object has no attribute ‘select’
tf.select()改成:tf.where() - AttributeError: ‘module’ object has no attribute ‘scalar_summary’
tf.scalar_summary() 改成:tf.summary.scalar() - AttributeError: ‘module’ object has no attribute ‘histogram_summary’
tf.histogram_summary() 改成:tf.summary.histogram() - AttributeError: ‘module’ object has no attribute ‘merge_all_summaries’
tf.merge_all_summaries() 改成:tf.summary.merge_all() - AttributeError: ‘module’ object has no attribute ‘SummaryWriter’
tf.train.SummaryWriter() 改成:tf.summary.FileWriter()
后续遇到类似的问题会持续更新。