codecamp

TensorFlow的InvalidArgumentError类

tf.errors.InvalidArgumentError

tf.errors.InvalidArgumentError 类

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

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

当操作接收到无效参数时触发.

例如,如果某个操作接收到的输入张量具有无效的值或形状,则可能发生该情况.例如,如果 tf.matmul 操作接收到的输入不是矩阵,则如果新形状与输入张量中的元素数不匹配,tf.reshape 操作将引发此错误.

属性

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

返回:

在Operation失败或无.

方法

__init__

__init__ (
node_def ,
op ,
message
)

创建一个 InvalidArgumentError.


InternalError的处理
NotFoundError如何引发
温馨提示
下载编程狮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; }