tensorflow2.0手势识别出错记录

1. TypeError: len is not well defined for symbolic Tensors. (packed_2:0) Please call x.shape rather than len(x) for shape information.

意思是tensor张量不能使用len()这个函数,可以把len(x_test)改为x_test.shape[0]同样可以得到测试集的长度。

2.ValueError: When using data tensors as input to a model, you should specify the steps_per_epoch argument.

使用tensor张量输入到模型中,需要在fit函数中加入参数steps_per_epoch,但是将数据集转为张量的形式对我来说有点晕,所以最后的解决办法是将数据集转为numpy的形式输入到模型中,使用张量还是不习惯那。

3. UnknownError: Failed to get convolution algorithm. This is probably because cuDNN failed to initialize, so try looking to see if a warning log message was printed above.

字面意思CUDNN出现问题了,有很多种情况都会出现这个错误,我第一次出现这个错误的原因是安装Nvidia显卡驱动时,cuDNN文件解压时放错了地方。第二次是将其他的模型的内存释放,最后可以尝试重启服务器。

4.ValueError: Input 0 of layer sequential is incompatible with the layer: expected ndim=4, found ndim=3. Full shape received: [None, 64, 64]

给数据增加一个维度,使数据和网络结构匹配[?,64,64,1]

x_train = x_train.reshape(x_train.shape[0], 64, 64, 1)
5.TypeError: Value passed to parameter ‘input’ has DataType uint8 not in list of allowed values: float32,float16

将输入模型的数组转为float32

img = tf.cast(img, tf.float32)
6.ValueError: ‘ReadVariableOp_1:value:0’ is not a valid scope name

命名不符合规则,去掉特殊字符或者没有目标文件夹

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值