美文网首页
Tensorflow Error

Tensorflow Error

作者: 嫩芽33 | 来源:发表于2017-08-18 11:24 被阅读0次

    # -*- 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()

    相关文章

      网友评论

          本文标题:Tensorflow Error

          本文链接:https://www.haomeiwen.com/subject/foaorxtx.html