codecamp

TensorFlow处理已存在的error

tf.errors.AlreadyExistsError

tf.errors.AlreadyExistsError 类

定义在:tensorflow/python/framework/errors_impl.py

请参阅指南:运行图>错误类和方便功能

当我们尝试创建的实体已经存在时引发.

例如,如果传递了现有文件的显式文件名,则运行保存文件(例如 tf.train.Saver.save)的操作可能会引发此异常.

属性:

  • error_code:整数错误代码描述 error .
  • message:错误消息描述 error .
  • node_def:NodeDef 原型代表操作失败了. 
  • op:失败的操作,如果知道的话.
  • 注意:如果失败的运算在运行时合成,例如一个 Send 或 Recv 运算,将不会有相应的 tf.Operation 对象.在这种情况下,这将返回 None,应该您使用 tf.OpError.node_def 来发现关于操作的信息.

返回:

返回失败的操作或 None.

方法

__init__

__init__ (
node_def ,
op ,
message
)

创建一个 AlreadyExistsError.


TensorFlow操作被中止
TensorFlow取消操作或步骤时引发的error
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

TensorFlow 函数介绍

TensorFlow 函数模块:tf

TensorFlow的image模块

TensorFlow使用之tf.io

TensorFlow使用之tf.keras

TensorFlow函数教程:tf.keras.applications

TensorFlow函数教程:tf.keras.backend

TensorFlow使用之tf.metrics

TensorFlow使用之tf.nn

TensorFlow使用之tf.python_io

TensorFlow 功能函数

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }