Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tensorflow: 'module' object has no attribute 'scalar_summary'

Tags:

tensorflow

I tried to run the following code to test my TensorBoard, however, when I ran the program, there is an error said:

'module' object has no attribute 'scalar_summary'

I want to know how can I fix this issue, thanks.

The following is the system info:

  • Operating System: Ubuntu 16.04 LTS
  • Tensorflow version: 0.12rc (master)
  • Running environment: Jupyter Notebook

Test program and Output: enter image description here

like image 392
Yuan Ma Avatar asked Dec 09 '16 17:12

Yuan Ma


2 Answers

The tf.scalar_summary() function was moved in the master branch, after the 0.12 release. You can now find it as tf.summary.scalar().

like image 83
mrry Avatar answered Nov 07 '22 17:11

mrry


In a new version of TF, all summary functions were renamed.

Summary functions have been consolidated under the tf.summary namespace.

  • tf.audio_summary should be renamed to tf.summary.audio
  • tf.contrib.deprecated.histogram_summary should be renamed to tf.summary.histogram
  • tf.contrib.deprecated.scalar_summary should be renamed to tf.summary.scalar
  • tf.histogram_summary should be renamed to tf.summary.histogram
  • tf.image_summary should be renamed to tf.summary.image
  • tf.merge_all_summaries should be renamed to tf.summary.merge_all
  • tf.merge_summary should be renamed to tf.summary.merge
  • tf.scalar_summary should be renamed to tf.summary.scalar
  • tf.train.SummaryWriter should be renamed to tf.summary.FileWriter
like image 30
Salvador Dali Avatar answered Nov 07 '22 19:11

Salvador Dali