微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

无效参数:没有足够的时间用于目标转换序列

如何解决无效参数:没有足够的时间用于目标转换序列

我试图运行这个 HTR 模型 https://github.com/arthurflor23/handwritten-text-recognition,但它给了我这个错误 Invalid argument: Not enough time for target transition sequence。问题,我认为在ctc_batch_cost。我的图片尺寸是 (137,518),文本的 max_len 是 137。我知道如何解决这个问题吗?

解决方法

我解决了这个问题,这是由于输入的大小。

Layer (type)                 Output Shape              Param #   
=================================================================
input (InputLayer)           [(None,1024,128,1)]    0         
_________________________________________________________________
conv2d (Conv2D)              (None,64,16)      160       
_________________________________________________________________
p_re_lu (PReLU)              (None,16)      16        
_________________________________________________________________
batch_normalization (BatchNo (None,16)      112       
_________________________________________________________________
full_gated_conv2d (FullGated (None,16)      4640      
_________________________________________________________________
conv2d_1 (Conv2D)            (None,32)      4640      
_________________________________________________________________
p_re_lu_1 (PReLU)            (None,32)      32        
_________________________________________________________________
batch_normalization_1 (Batch (None,32)      224       
_________________________________________________________________
full_gated_conv2d_1 (FullGat (None,32)      18496     
_________________________________________________________________
conv2d_2 (Conv2D)            (None,512,16,40)       10280     
_________________________________________________________________
p_re_lu_2 (PReLU)            (None,40)       40        
_________________________________________________________________
batch_normalization_2 (Batch (None,40)       280       
_________________________________________________________________
full_gated_conv2d_2 (FullGat (None,40)       28880     
_________________________________________________________________
dropout (Dropout)            (None,40)       0         
_________________________________________________________________
conv2d_3 (Conv2D)            (None,48)       17328     
_________________________________________________________________
p_re_lu_3 (PReLU)            (None,48)       48        
_________________________________________________________________
batch_normalization_3 (Batch (None,48)       336       
_________________________________________________________________
full_gated_conv2d_3 (FullGat (None,48)       41568     
_________________________________________________________________
dropout_1 (Dropout)          (None,48)       0         
_________________________________________________________________
conv2d_4 (Conv2D)            (None,256,4,56)        21560     
_________________________________________________________________
p_re_lu_4 (PReLU)            (None,56)        56        
_________________________________________________________________
batch_normalization_4 (Batch (None,56)        392       
_________________________________________________________________
full_gated_conv2d_4 (FullGat (None,56)        56560     
_________________________________________________________________
dropout_2 (Dropout)          (None,56)        0         
_________________________________________________________________
conv2d_5 (Conv2D)            (None,64)        32320     
_________________________________________________________________
p_re_lu_5 (PReLU)            (None,64)        64        
_________________________________________________________________
batch_normalization_5 (Batch (None,64)        448       
_________________________________________________________________
reshape (Reshape)            (None,256)          0         
_________________________________________________________________
bidirectional (Bidirectional (None,256)          296448    
_________________________________________________________________
dense (Dense)                (None,256)          65792     
_________________________________________________________________
bidirectional_1 (Bidirection (None,256)          296448    
_________________________________________________________________
dense_1 (Dense)              (None,332)          85324     
=================================================================
look at the final layer ( dense_1 ) the second dimension is 256,so your text label should be <=256,not more. The problem comes from here.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。