Skip to content
This repository has been archived by the owner on Jun 11, 2020. It is now read-only.

datamanager.py #24

Open
yogixRush opened this issue Aug 2, 2018 · 6 comments
Open

datamanager.py #24

yogixRush opened this issue Aug 2, 2018 · 6 comments

Comments

@yogixRush
Copy link

在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
Copy link

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

@Belval
Copy link
Owner

Belval commented Oct 17, 2018

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
Copy link

jabgle commented Nov 10, 2018

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

@ZhangSibo9972
Copy link

ZhangSibo9972 commented Dec 25, 2018

我也遇到了这个问题。最后查出来是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
Copy link

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

@LW-CVer
Copy link

LW-CVer commented Mar 24, 2020

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants