Tag Archives: Tensorflow error: attributeerror: module

Tensorflow error: attributeerror: module ‘tensorflow_ API. V1. Train ‘has no attribute’ summarywriter ‘

TensorFlow Error: AttributeError: module ‘tensorflow._api.v1.train’ has no attribute ‘SummaryWriter’ etc.
Analysis: Version update, method call method change
Solution.

Error oRIGINAL METHOD NEW METHOD
AttributeError: module ‘tensorflow._api.v1.train’ has no attribute ‘SummaryWriter’ tf.train.SummaryWriter() tf.summary.FileWriter()
AttributeError: module ‘tensorflow’ has no attribute ‘merge_all_summaries’ tf.merge_all_summaries() tf.summary.merge_all()
AttributeError: module ‘tensorflow’ has no attribute ‘histogram_summary’ tf.histogram_summary() tf.summary.histogram()
AttributeError: module ‘tensorflow’ has no attribute ‘scalar_summary’ tf.scalar_summary() tf.summary.scalar()
AttributeError: module ‘tensorflow’ has no attribute ‘image_summary’ tf.image_summary() tf.summary.image()
AttributeError: module ‘tensorflow’ has no attribute ‘audio_summary tf.audio_summary() tf.summary.audio()
AttributeError: module ‘tensorflow’ has no attribute ‘merge_summary’ tf.merge_summary() tf.summary.merge()

 

Tensorflow error: attributeerror: module ‘tensorflow’ has no attribute ‘unpack’ (‘pack ‘)

Tensorflow: attributeerror: module ‘tensorflow’ has no attribute ‘unpack’ (‘pack ‘)

As shown in the figure:

AttributeError: module ‘tensorflow’ has no attribute ‘unpack’

Analysis: after tensorflow version 1.0 + is updated, the method name changes

Solution:

error report

before update

after update

attributeerror: module ‘tensorflow’ has no attribute ‘unpack’

after update tf.unpack () tf.unstack ()
AttributeError: module ‘tensorflow’ has no attribute ‘pack’ tf.pack () tf.stack ()