# ROCMultiClass error while running textCNN

**URL:** <https://community.konduit.ai/t/rocmulticlass-error-while-running-textcnn/442>\
**Category:** DL4J\
**Created:** [April 23, 2020, 12:14pm UTC](https://community.konduit.ai/t/rocmulticlass-error-while-running-textcnn/442 "2020-04-23T12:14:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![blackwingf](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/blackwingf/32/87_2.png) [@blackwingf](https://community.konduit.ai/u/blackwingf)\
**Post date:** [April 23, 2020, 12:14pm UTC](https://community.konduit.ai/t/rocmulticlass-error-while-running-textcnn/442/1 "2020-04-23T12:14:40Z")

</div>

I replaced defaut Evaluation with ROCMultiClass in textCNN example.  
EvaluativeListener eva = new EvaluativeListener(testIter, 1, InvocationType.EPOCH\_END, new ROCMultiClass());  
net.setListeners(new ScoreIterationListener(100), eva);  
net.fit(trainIter, nEpochs);

Error occured when evaluating：  
Exception in thread “main” java.lang.RuntimeException: cudaMalloc failed  
at org.nd4j.jita.allocator.pointers.cuda.cudaStream\_t.synchronize(cudaStream\_t.java:41)  
at org.nd4j.jita.handler.impl.CudaZeroHandler.alloc(CudaZeroHandler.java:307)  
at org.nd4j.jita.allocator.impl.AtomicAllocator.allocateMemory(AtomicAllocator.java:526)  
at org.nd4j.jita.allocator.impl.AtomicAllocator.allocateMemory(AtomicAllocator.java:438)  
at org.nd4j.linalg.jcublas.buffer.BaseCudaDataBuffer.initPointers(BaseCudaDataBuffer.java:297)  
at org.nd4j.linalg.jcublas.buffer.BaseCudaDataBuffer.(BaseCudaDataBuffer.java:316)  
at org.nd4j.linalg.jcublas.buffer.CudaDoubleDataBuffer.(CudaDoubleDataBuffer.java:62)  
at org.nd4j.linalg.jcublas.buffer.factory.CudaDataBufferFactory.create(CudaDataBufferFactory.java:378)  
at org.nd4j.linalg.factory.Nd4j.createBuffer(Nd4j.java:1430)  
at org.nd4j.linalg.jcublas.JCublasNDArrayFactory.create(JCublasNDArrayFactory.java:1543)  
at org.nd4j.linalg.jcublas.JCublasNDArrayFactory.create(JCublasNDArrayFactory.java:1538)  
at org.nd4j.linalg.factory.Nd4j.create(Nd4j.java:4298)  
at org.nd4j.evaluation.classification.ROC.eval(ROC.java:626)  
at org.nd4j.evaluation.BaseEvaluation.eval(BaseEvaluation.java:298)  
at org.nd4j.evaluation.classification.ROCMultiClass.eval(ROCMultiClass.java:236)  
at org.nd4j.evaluation.BaseEvaluation.eval(BaseEvaluation.java:308)  
at org.deeplearning4j.nn.graph.ComputationGraph.doEvaluationHelper(ComputationGraph.java:4183)  
at org.deeplearning4j.nn.graph.ComputationGraph.doEvaluationHelper(ComputationGraph.java:4123)  
at org.deeplearning4j.nn.graph.ComputationGraph.doEvaluation(ComputationGraph.java:4081)  
at org.deeplearning4j.nn.graph.ComputationGraph.doEvaluation(ComputationGraph.java:4068)  
at org.deeplearning4j.optimize.listeners.EvaluativeListener.invokeListener(EvaluativeListener.java:243)  
at org.deeplearning4j.optimize.listeners.EvaluativeListener.onEpochEnd(EvaluativeListener.java:213)  
at org.deeplearning4j.nn.graph.ComputationGraph.fit(ComputationGraph.java:1090)  
at org.deeplearning4j.nn.graph.ComputationGraph.fit(ComputationGraph.java:1018)  
at org.deeplearning4j.nn.graph.ComputationGraph.fit(ComputationGraph.java:1006)  
at org.deeplearning4j.examples.convolution.sentenceclassification.TextCNN4MultiIntentCommand.main(TextCNN4MultiIntentCommand.java:170)

by the way，[https://community.konduit.ai](https://community.konduit.ai) is not easy to access，even with vpn.

---

<div class="post-metadata">

**Author:** ![treo](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/treo/32/47_2.png) [@treo](https://community.konduit.ai/u/treo)\
**Post date:** [April 23, 2020, 12:34pm UTC](https://community.konduit.ai/t/rocmulticlass-error-while-running-textcnn/442/2 "2020-04-23T12:34:14Z")

</div>

This usually only happens when you don’t have enough GPU memory. Maybe you were running very close to the limit already?

How much actual free gpu memory do you have before you run the evaluation?

> [@blackwingf](#):
>
> by the way，[https://community.konduit.ai](https://community.konduit.ai) is not easy to access，even with vpn.

Oh, that is unfortunate. Can you give us more information about what isn’t working for you?

---

<div class="post-metadata">

**Author:** ![blackwingf](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/blackwingf/32/87_2.png) [@blackwingf](https://community.konduit.ai/u/blackwingf)\
**Post date:** [April 23, 2020, 12:37pm UTC](https://community.konduit.ai/t/rocmulticlass-error-while-running-textcnn/442/3 "2020-04-23T12:37:17Z")

</div>

My GPU is nvidia p620 with 2GB RAM.  
Maybe I should switch to CPU backend .

When I visit  
[https://community.konduit.ai](https://community.konduit.ai)  
Most of the case I got timeout response

---

<div class="post-metadata">

**Author:** ![treo](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/treo/32/47_2.png) [@treo](https://community.konduit.ai/u/treo)\
**Post date:** [April 23, 2020, 1:22pm UTC](https://community.konduit.ai/t/rocmulticlass-error-while-running-textcnn/442/4 "2020-04-23T13:22:46Z")

</div>

> [@blackwingf](#):
>
> My GPU is nvidia p620 with 2GB RAM.

Yes, that seems like it might end up being not enough.

> [@blackwingf](#):
>
> When I visit  
> [https://community.konduit.ai](https://community.konduit.ai)  
> Most of the case I got timeout response

Oh, that is bad. I’m not sure how to help you there though 😕 It works fine for everyone who I’ve asked to test so far.
