githubharald / CTCDecoder

Connectionist Temporal Classification (CTC) decoding algorithms: best path, beam search, lexicon search, prefix search, and token passing. Implemented in Python.
https://towardsdatascience.com/3797e43a86c
MIT License
817 stars 182 forks source link

module 'pyopencl' has no attribute 'enqueue_write_buffer #5

Closed greenpdx closed 5 years ago

greenpdx commented 5 years ago

I am having a difficult time using the GPU. it runs ok with out GPU but with I get this error

=====Line example (GPU)===== Traceback (most recent call last): File "main.py", line 147, in testLineExampleGPU() File "main.py", line 122, in testLineExampleGPU resBatch = BestPathCL.ctcBestPathCL(batch, classes, clWrapper) File "/home/ubuntu/handwrite/CTCDecoder/src/BestPathCL.py", line 109, in ctcBestPathCL labelStrBatch = clWrapper.compute(batch) File "/home/ubuntu/handwrite/CTCDecoder/src/BestPathCL.py", line 84, in compute cl.enqueue_write_buffer(self.queue, self.batchBuf, batch.astype(np.float32), is_blocking=False) AttributeError: module 'pyopencl' has no attribute 'enqueue_write_buffer'

githubharald commented 5 years ago

I use version pyopencl==2018.1.1+cl12 The GPU decoding is experimental and by default off and I will not do any changes to be compatible with some other OpenCL version.

vikashranjan commented 4 years ago

@greenpdx I changed to enqueue_copy and it worked. https://github.com/vikashranjan/CTCDecoder/blob/master/src/BestPathCL.py