Belval / CRNN

A TensorFlow implementation of https://github.com/bgshih/crnn
MIT License
297 stars 101 forks source link

datamanager.py #24

Open yogixRush opened 6 years ago

yogixRush commented 6 years ago

在def __generate_all_train_batches(self)里面, batch_dt = sparse_tuple_from( np.reshape( np.array(raw_batch_la), (-1) ) ) 这样会报错: int型没有len属性 改成 batch_dt = sparse_tuple_from( np.array(raw_batch_la) ) 就能训练了,但训练非常非常慢,10小时loss没有任何降低

Qzhaohong commented 5 years ago

@Belval I met the same issue, is above change from @yogixRush right ?

Belval commented 5 years ago

Can any of you give me his configuration and the format of your training samples?

On my Ubuntu 18.04 machine with python 3 this does not cause any issues.

jabgle commented 5 years ago

我跟你改了,还是报这个错啊

ZhangSibo9972 commented 5 years ago

我也遇到了这个问题。最后查出来是numpy.array()函数的原因。源码里是64个图片一组送进去的,但是特殊情况下如果64张图片的word标记的长度是一样的,numpy.array()的转换结果可能变成1维,进而引起这个错误。增加batch_size(我从64改到128)似乎可以解决这个问题,不过治标不治本。或者尝试进入sparse_tuple_from函数里,在utils.py第16行: for n, seq in enumerate(sequences): 将sequences替换为sequences.base不知道能不能解决问题。

buyanfangqi commented 5 years ago

你好,最后是怎么解决的呢?

LW-CVer commented 4 years ago

我的是输入数据一样长,所以将传入的sequences再做一次维度变换就好了(因为有时候sequences是一维的数据)