Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Add predict sample code for lstm+ctc ocr. Also update it's README.md #4365

Merged
merged 1 commit into from Jan 11, 2017

Conversation

BobLiu20
Copy link
Contributor

I think a predict sample code for lstm+ctc ocr is very useful.

Related issue point: issue

@piiswrong
Copy link
Contributor

Thanks. Somehow I missed this. Merged

@piiswrong piiswrong merged commit d6328a5 into apache:master Jan 11, 2017
@fanlu
Copy link

fanlu commented Jan 12, 2017

When I compile make in mxnet/amalgamation
The following error occurred
/workspace/mxnet/amalgamation/../include/mxnet/base.h:15:21: fatal error: nnvm/op.h: 没有那个文件或目录
@BobLiu20 @piiswrong
@antinucleon When this can be done?

@BobLiu20
Copy link
Contributor Author

@fanlu Hi , first of all your compile error has no direct bearing upon the PR.

I guess you are using a incorrect git clone to get source code. checking this page.
and take care:

git clone https://github.com/dmlc/mxnet.git --recursive

do not lost --recursive argument in here.

@fanlu
Copy link

fanlu commented Jan 15, 2017

@BobLiu20 I have used the compiler before --recursive, the latest cod include the nnvm module, but you fork out of the time there is no such this module. This should be inside the issue #4667

@fanlu
Copy link

fanlu commented Jan 19, 2017

@BobLiu20 I forked your branch from https://github.com/BobLiu20/mxnet, and I got an error

plugin/warpctc/./warpctc-inl.h:123:5: error: 'ctcComputeInfo' was not declared in this scope
ctcComputeInfo info;
^
plugin/warpctc/./warpctc-inl.h:125:7: error: 'info' was not declared in this scope
info.loc = CTC_CPU;
^
plugin/warpctc/./warpctc-inl.h:175:61: error: 'info' was not declared in this scope
input_lengths.size(), info,
^
Makefile:197: recipe for target 'build/plugin/warpctc/warpctc.o' failed
make: *** [build/plugin/warpctc/warpctc.o] Error 1
make: *** Waiting for unfinished jobs....
can you help me about this problum? thx

@BobLiu20
Copy link
Contributor Author

@fanlu Hi, Regrading to this issue, a solution appear in this site. You can get the reason and solution after review it.

@fanlu
Copy link

fanlu commented Jan 20, 2017

@BobLiu20 It worked, thx

2017-01-19 14:00:13,361 Saved checkpoint to "model-0010.params"
iter
2017-01-19 14:04:21,496 Epoch[9] Validation-Accuracy=0.958906
2017-01-19 14:04:21,505 Saved checkpoint to "ocr-0010.params"

the Validation-Accuracy is 0.958906, but the Inference is almost wrong
admin@8f585fd9686f:/export/App/work/data/bob_mxnet/example/warpctc$ python ocr_predict.py
the num is 764, Result: 74454
admin@8f585fd9686f:/export/App/work/data/bob_mxnet/example/warpctc$ python ocr_predict.py
the num is 558, Result: 758
admin@8f585fd9686f:/export/App/work/data/bob_mxnet/example/warpctc$ python ocr_predict.py
the num is 5117, Result: 7117
admin@8f585fd9686f:/export/App/work/data/bob_mxnet/example/warpctc$ python ocr_predict.py
the num is 447, Result: 907
admin@8f585fd9686f:/export/App/work/data/bob_mxnet/example/warpctc$ python ocr_predict.py
the num is 708, Result: 708
admin@8f585fd9686f:/export/App/work/data/bob_mxnet/example/warpctc$ python ocr_predict.py
the num is 519, Result: 7842
admin@8f585fd9686f:/export/App/work/data/bob_mxnet/example/warpctc$ python ocr_predict.py
the num is 416, Result: 7416
admin@8f585fd9686f:/export/App/work/data/bob_mxnet/example/warpctc$ python ocr_predict.py
the num is 302, Result: 7302
admin@8f585fd9686f:/export/App/work/data/bob_mxnet/example/warpctc$ python ocr_predict.py
the num is 728, Result: 7428

@xinghedyc
Copy link

@fanlu @BobLiu20 I think I meet the same problem, the accuracies dose not match between inference and training.

@lji72
Copy link

lji72 commented Feb 22, 2017

@fanlu @xinghedyc To solve it, you just provide the init_states values which are zeros. and #5047

@fanlu
Copy link

fanlu commented Feb 22, 2017

@lji72 It workes well,thx

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

Successfully merging this pull request may close these issues.

None yet

5 participants