Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocropus-rtrain broken #178

Closed
jze opened this issue Jan 31, 2017 · 8 comments
Closed

ocropus-rtrain broken #178

jze opened this issue Jan 31, 2017 · 8 comments
Labels

Comments

@jze
Copy link
Contributor

jze commented Jan 31, 2017

commit 7020a76 broke ocropus-rtrain. Error message is
TypeError: sum() takes no keyword arguments`

commit 952910e works

@lunactic
Copy link

lunactic commented Feb 1, 2017

Just stumbled upon that as well. From what I can tell it seems that the standard sum() methods are called instead of the ones from numpy?

@zuphilip
Copy link
Collaborator

zuphilip commented Feb 1, 2017

Hm.. I tested with the newest commit by running ./run-rtrain and this seems to work fine.

Can you describe in more details how you did use the functions, such that I can reproduce the error here?

There was recently a commit which was normalizing the import statements #154, which could maybe lead to something as described here...

@zuphilip
Copy link
Collaborator

zuphilip commented Feb 1, 2017

Ah... my mistake. It took the old installed version. I can see this now:

root@a036296c9ed8:/work# ./run-rtrain
++ dirname ./run-rtrain
+ BASE=.
+ tar -zxf ./tests/uw3-500.tgz
+ ./ocropus-rtrain 'book/*/*.bin.png' -o uw3-500-model
# inputs 500
# tests None
# CenterNormalizer
# using default codec
# charset size 157 [ ~!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWX
[\]^_`abcdefghijklmnopqrstuvwxyz{|}]
# last_trial 0
Traceback (most recent call last):
  File "./ocropus-rtrain", line 289, in <module>
    pcs = network.trainSequence(line,cs,update=do_update,key=fname)
  File "/work/ocrolib/lstm.py", line 903, in trainSequence
    self.aligned = array(ctc_align_targets(self.outputs,self.targets,debug=sel
debug_align))
  File "/work/ocrolib/lstm.py", line 812, in ctc_align_targets
    outputs = outputs * 1.0/sum(outputs,axis=1)[:,newaxis]
TypeError: sum() takes no keyword arguments

@zuphilip
Copy link
Collaborator

zuphilip commented Feb 1, 2017

Okay, I hope that 2222227 will fix this. Can some confirm that? Then I will merge the PR #179.

@QuLogic
Copy link
Contributor

QuLogic commented Feb 1, 2017

That's why it's best not to use *-imports. Really should replace those with np.<func> instead of shadowing builtins.

@lunactic
Copy link

lunactic commented Feb 1, 2017

I will test it tomorrow morning and come back with results

@zuphilip
Copy link
Collaborator

zuphilip commented Feb 1, 2017

@QuLogic Yes, we created an issue for that #176 which also links to your commits. This seems to be a good idea and I hope we find time to continue working on this.

@lunactic
Copy link

lunactic commented Feb 2, 2017

2222227 seems to fix it for me.

Thanks for the quick fix!

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

No branches or pull requests

4 participants