# -*- coding:utf-8 -*-
AttributeError: 'module' object has no attribute 'image_summary'
tf.image_summary()改為tf.summary.image()
AttributeError: 'module' object has no attribute 'histogram_summary'
tf.histogram_summary()改為tf.summary.histogram()
AttributeError: 'module' object has no attribute 'scalar_summary'
tf.scalar_summary()? ? tf.summary.scalar()
AttributeError: 'module' object has no attribute 'merge_all_summaries'
tf.merge_all_summaries()? tf.summary.merge_all()
ValueError: Only call `softmax_cross_entropy_with_logits` with named arguments (labels=..., logits=..., ...)
函數中參數(y,y_) 改為(labels=y_, logits=y)
AttributeError: 'module' object has no attribute 'SummaryWriter'
tf.train.SummaryWriter()改為tf.summary.FileWriter()
ImportError: No module named Tkinter? 原因在于顯示不了圖形界面
將import matplotlib.pyplot as plt 改為
import matplotlib
matplotlib.use('Agg')
之后將要顯示的圖直接存下來
from matplotlib.pyplot import plot,savefig
plot(train_X,train_Y,'ro',label='Original data')
savefig(' Original data.jpg')
tf.initialize_all_variables()改為tf.global_variables_initializer()
AttributeError: 'module' object has no attribute 'select'
將 tf.select() ?改為 ?tf.where()