You can look to the internet and you can search many examples and tutorials but you can get errors.
How to fix that:
The first step is to know what tensorflow version of you use.
[mythcat@localhost ~]$ python -c "import tensorflow; print(tensorflow.__version__)"
Then yo need to know what parts from tensorflow old version is deprecated from the last version.
One superannuated method is to fix old source code with this:
A better method is to fix your source code and read the documentation.
import tensorflow as tf tf.scalar_summary = tf.summary.scalar tf.merge_all_summaries = tf.summary.merge_all tf.train.SummaryWriter = tf.summary.FileWriter
Have a better day possible.