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

warpctc: module object has no at tribute 'WarpCTC'?? #7002

Closed
beyondli opened this issue Jul 11, 2017 · 6 comments
Closed

warpctc: module object has no at tribute 'WarpCTC'?? #7002

beyondli opened this issue Jul 11, 2017 · 6 comments

Comments

@beyondli
Copy link

I compiled warpctc project followed the description of README, but when run toy_ctc.py, the error is no attribute 'WarpCTC', seems just revised config.mk can be done, no others need .so why warpCTC is failed regiserter to mxnet??

@Soonhwan-Kwon
Copy link
Contributor

Would you provide some error message or
export LD_LIBRARY_PATH by below command (Please fill out the /path/to/ to your actual path)

export LD_LIBRARY_PATH=/path/to/warp-ctc/build:$LD_LIBRARY_PATH

then rerun the toy_ctc.py?

@beyondli
Copy link
Author

@Soonhwan-Kwon ,thanks! yes ,after added LD_LIBRARY_PATH, this error is OK, but the more stranger message occurs:
2017-07-12 15:50:48,415 Start training with [gpu(0)]
terminate called after throwing an instance of 'std::runtime_error'
what(): Error: compute_ctc_loss, stat = cuda memcpy or memset failed.
I check all the code I could checked ,found this error message comes from warpCTC itself, not mxnet.

in Gpu_ctc.h setup_gpu_metadata function, there are several places can cause this error, one of them is :
cuda_status = cudaMemcpyAsync(&(repeats_[start_idx]), repeats,
(end_idx - start_idx) * sizeof(int),
cudaMemcpyHostToDevice, stream_);
if (cuda_status != cudaSuccess)
return CTC_STATUS_MEMOPS_FAILED;
,seems warpCTC wrong with cuda meme op, but I have compiled warpCTC successfully, and test torch code warpCTC with GPU is OK. so I am really confused with this .......

@Soonhwan-Kwon
Copy link
Contributor

Soonhwan-Kwon commented Jul 12, 2017

Is your mxnet version latest? There was memcpy error( #6121 ) because of contrib.warpctc once but as far as I know, it is okay now.
So 1. you can remove your version of mxnet and clone recursive/compile latest build of mxnet.
2. If you don't want to clone latest mxnet again, I recommend to re-compile but remove the folder ctc_include, and files ctc_loss.cc, ctc_loss.cu and ctc_loss-inl.h from ~/mxnet/src/operator/contrib.
(But I'm not sure your error would be solved by number 2.)

@beyondli
Copy link
Author

beyondli commented Jul 13, 2017

well done! I read#6121, I think the num 2 choice is essential, num 1 is easy but no thinking anything :). I version is almost new 0.10.0. I followed 2,then train is OK, so cool!
but is also some code leave info ,my train info is:
2017-07-13 10:21:31,915 Epoch[0] Batch [13900] Speed: 1955.20 samples/sec Accuracy=0.999844
S_ 9
S_ 9
S_ 9
S_ 9
why print so many "S_ 9" between two Batch info, however that doesnot matter!
BTW,after 13900 batch, acdcuracy is 0.999844, actually amazing me :) I will download the newest version later to try warpctc.
================MY SUGGESTION for warpctc plugin=============
when I used mxnet , I learned a lot of ,lot of ,not just how to use it ,but also the design skill, optimized skill behind mxnet. it has been my most favorite DL framework, the most!
but to each new MXNETer like me , the small failed sometimes really frustrated, one of them is the so many issue is waiting for reply, some of them maybe no reply at all, so sometiems work is suspended. So the readme of each project based on mxnet should be detailed.

to warpctc plugin ,my suggestion is

1:config.mk related info is from

WARPCTC_PATH = $(HOME)/warp-ctc
MXNET_PLUGINS += plugin/warpctc/warpctc.mk

to

You also need to add warp-ctc/build/ to your LD_LIBRARY_PATH
WARPCTC_PATH = $(HOME)/warp-ctc
MXNET_PLUGINS += plugin/warpctc/warpctc.mk

2: if the comparitibility between warpctc and contributer's version is not fixed, I suggest directly delete the choice 2 files from the repository until fixed by namespace isolate or other method.

well, finally ,hope somedays ,I could become one of the contributers to contribute something :)

@Soonhwan-Kwon
Copy link
Contributor

Glad to hear problem solved, I agree with MXNet is great platform, and nowadays many contributors contributes to build awesome documents including installation, and especially Warp CTC is now get into the builtin plugin as contrib.warpctc, I expect small failures will goes away.

@vandanavk
Copy link
Contributor

Anyone still seeing this issue? I have tried all possible solutions suggested in various GitHub issues. But I still see this error with speech recognition example. It seems to work fine with the ctc example.

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

3 participants