Conversation
plugin/warpctc/warpctc-inl.h
Outdated
| &cpu_alloc_bytes), | ||
| "Error: get_workspace_size in inf_test"); | ||
| std::cout << cpu_alloc_bytes << std::endl; | ||
| void* ctc_cpu_workspace = malloc(cpu_alloc_bytes); |
|
Thanks all, I will try all your ideas today. |
|
I add following inferType function virtual bool InferType(std::vector *in_type, I want to make label be int type. In python code, I use symbol.Cast: label = mx.sym.Cast(data = label, dtype = 'int32') This works OK under CPU mode. However, when I switch ctx to gpu, I get following error. /dl/mxnet/dmlc-core/include/dmlc/logging.h:235: [11:51:03] src/ndarray/ndarray_function.cu:19: Check failed: (to->type_flag_) == (from.type_flag_) Source and target must have the same data type when copying across devices. I think this occurs when copy label data generated by DataIter from cpu to gpu. Here, I find to->type_flag_ = 0 (float32) and from->type_flag_ = 4 (int32) |
|
I find this is because, in Copy<cpu, cpu>, it can do type cast: void Copy<cpu, cpu>(const TBlob &from, TBlob *to, But in Copy<cpu, gpu>, it can not do type cast. So, my problem is while I still can not get int type label after implement InferType. |
|
WarpCTC need label to be a int* in CPU context. How can I make other symbols in GPU while make label in CPU? |
|
Currently the assumption is that the inputs need to be in the same context, due to the type inference algorithm The simplest way is to copy the GPU array to CPU during computation on demand. @antinucleon knows how to allocate a cpu temp space. |
plugin/warpctc/warpctc-inl.h
Outdated
| Stream<xpu> *s = ctx.get_stream<xpu>(); | ||
| Tensor<xpu, 2> grad = in_grad[warpctc_enum::kData].FlatTo2D<xpu, real_t>(s); | ||
| grad.dptr_ = grads; | ||
|
|
There was a problem hiding this comment.
I fall to test under GPU, so I copy memory to cpu and run computer_ctc_loss, and get grads. I want to set in_grad to grads.
Here, I do not know if in_grad can take values from grads.
|
any updates on this ? |
|
CPU works now. I am working on GPU these days. |
|
I have make everything works now (in both CPU and GPU). And I am working on write an example to prove rightness of CTC. Will submit code in next week. |
Makefile
Outdated
| ifeq ($(USE_OPENCV), 1) | ||
| CFLAGS += -DMXNET_USE_OPENCV=1 `pkg-config --cflags opencv` | ||
| LDFLAGS += `pkg-config --libs opencv` | ||
| LDFLAGS += -lopencv_core -lopencv_highgui -lopencv_imgproc -lopencv_imgcodecs |
There was a problem hiding this comment.
I will revert them when I do finial submit. Thanks!
06fd3f1 to
97a4891
Compare
|
@xlvector when running lstm_ocr.py,one error happen: |
|
@Yang507 you can download Xerox.ttf from http://www.webpagepublicity.com/free-fonts/x/Xerox%20Sans%20Serif%20Narrow.ttf and put it in ./data/ Can you paster all error messages? |
|
I use cnn_ocr.py(https://github.com/xlvector/learning-dl/tree/master/mxnet/ocr), |
|
@livedimg we can discuss in that repos. |
|
@xlvector Thanks!I download the Xerox.ttf from the link and put in my one directory,but the result has the same error. |
|
seems this error is just because of captcha. can you write a test script to make python-captcha work? |
|
I change the learing rate and make learning rate =0.005,the Train-Accuracy is closed to 1. |
|
@Yang507 I have meet a same problem with u, when I use captcha.gennerate() method, it occurs a same problem, TypeError: must be sequence of length 4, not 2. How do u do to solve this problem? |
|
@sinmaystar you could input follow commands in your terminal:sudo pip install -U Pillow,then run lstm_ocr.py again, I almost forget it. |
|
@Yang507 just update Pillow package is alright? my pillow version is 2.3.0, what's your pillow package version? |
|
my Pillow version is 3.3 now , I forget if I have Pillow package before I update Pillow @sinmaystar |
|
@Yang507 can u run this code successfully just right now? are u sure its Pillow's problem? I have updated Pillow but its still not working |
|
@sinmaystar you can refer to lepture/captcha#7 |
|
@xlvector I met a same problem with you when I run lstm_ocr.py with my own data(number=18), occur following error: I know my data format is not match with the random captcha format, but I don't know how to write a iterator to load my captcha data and train it with lstm_ocr.py, I want to get your help and i'm grateful. |
|
能不能在你的wrapctc的例子里多写点介绍。 |
|
@thewintersun 其实相比于examples/rnn里面的例子,就改了一行。 |
|
@xlvector The log you train lstm shows the network just take less than 40 minutes to converge and finished just in epoch 0 . So , I wonder do you set BATCH_SIZE (in LSTM_OCR) very big(160 or 320 )? or learning rate a little lower (not 0.005)? I run lstm_ocr.py in GTX980ti, the result isn't very good as yours (about 0.09)and take me about 3 hours. |
|
@anxingle did u run lstm_ocr.py example successfully ? |
|
@sinmaystar Yeah,it's really hard to compile. Do you set $LD_LIBRARY_PATH (let libwarpctc.so in the path)? and edit make/config.mk ,let warpctc_path contain warp-ctc. |
Can you tell me where is your warp-ctc and how about your config.mk and more info? —You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or mute the thread. |
|
@anxingle Where can I find libwarpctc.so file? and how you set $LD_LIBRARY_PATH ? I can not find libwarpctc.so file after compile warp-ctc |
|
@sinmaystar in warp-ctc/build . You can use the command to find it: find /home/$USER/warp-ctc/ -name libwarpctc.so. And it shows the message: /home/a/warp-ctc/build/libwarpctc.so . Then you edit the ~/.bashrc,add the line export LD_LIBRARY_PATH="/home/a/warp-ctc/build:/usr/local/cuda-7.5/lib64:$LD_LIBRARY_PATH"(this is my own path) to the end of the file. |
|
@anxingle thanks for your help I have run this example successfully. |
|
When predict using: |
|
I also meet the error, how do u integrate baidu warp-ctc? |
|
你好,我用mxnet中的mxnet_predict.py进行预测的时候,好像不支持GPU的选项,只能在CPU下跑,用GPU会卡住,报terminate called without an active exception的错误 |
|
mxnet当时只是玩一玩,没深做。
…On Fri, Sep 15, 2017 at 2:50 PM, wuchuanying ***@***.***> wrote:
你好,我用mxnet中的mxnet_predict.py进行预测的时候,好像不支持GPU的选项,只能在CPU下跑,用GPU会卡住,报terminate
called without an active exception的错误
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2326 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATT_GBKViUAVaRdSBma-Oz_pwymots7Aks5sih5IgaJpZM4ItWu7>
.
|
The code is not ready for merge! (Related to issue #2305)
Just want you to help me review code in plugin/warpctc/ to see if I make large mistakes. (There are many debug logs in code, I will remove them at last)
Current code can run in CPU mode (can run means will not crash, I does not check if results is right).
For GPU mode, it will crash.