# Erro running GloVe example

**URL:** <https://community.konduit.ai/t/erro-running-glove-example/483>\
**Category:** DL4J\
**Created:** [May 5, 2020, 11:58pm UTC](https://community.konduit.ai/t/erro-running-glove-example/483 "2020-05-05T23:58:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gdelrio](https://avatars.discourse-cdn.com/v4/letter/g/7993a0/32.png) [@gdelrio](https://community.konduit.ai/u/gdelrio)\
**Post date:** [May 5, 2020, 11:58pm UTC](https://community.konduit.ai/t/erro-running-glove-example/483/1 "2020-05-05T23:58:41Z")

</div>

Hi,

I’m now trying the GloVeExample code using CPU on a linux box and using dl4j 1 beta 6. I have installed two different installations in my machine, one using CPU and another using GPU. This example I’m trying it in the installation for CPU.

I can compile/execute it or run it using the runexamples.sh script, but in both cases I get errors.

When compile it and execute it directly, I got the following error:

Exception in thread “main” java.lang.IllegalStateException: Multi-GPU word2vec/doc2vec isn’t available atm  
at org.deeplearning4j.models.sequencevectors.SequenceVectors.fit(SequenceVectors.java:248)  
at GloVeExample.main(GloVeExample.java:76)

line 76 includes the instruction: glove.fit();

When executed from the runexamples.sh, I got the following error:

o.d.m.s.SequenceVectors - Building learning algorithms:  
o.d.m.s.SequenceVectors - building ElementsLearningAlgorithm: [GloVe]  
o.d.m.e.l.i.e.GloVe - GloVe params: {Max Memory: [1], Learning rate: [0.1], Alpha: [0.75], xMax: [100.0], Symmetric: [true], Shuffle: [true]}  
o.d.m.g.AbstractCoOccurrences - Actual memory limit: [1073741824]  
o.d.m.g.AbstractCoOccurrences - Number of word pairs saved so far: [47194]  
o.d.m.g.AbstractCoOccurrences - CoOccurrences map was built.  
o.d.m.s.SequenceVectors - Starting learning process…  
Exception in thread “VectorCalculationsThread 0” java.lang.RuntimeException: java.lang.UnsupportedOperationException  
at org.deeplearning4j.models.sequencevectors.SequenceVectors$VectorCalculationsThread.run(SequenceVectors.java:1343)  
Caused by: java.lang.UnsupportedOperationException  
at org.deeplearning4j.models.embeddings.learning.impl.elements.GloVe.learnSequence(GloVe.java:136)  
at org.deeplearning4j.models.sequencevectors.SequenceVectors.trainSequence(SequenceVectors.java:399)  
at org.deeplearning4j.models.sequencevectors.SequenceVectors$VectorCalculationsThread.run(SequenceVectors.java:1274)

I appreciate if you could give me some hint on how to work this out.

Best,

Gabriel

---

<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:** [May 6, 2020, 10:08am UTC](https://community.konduit.ai/t/erro-running-glove-example/483/2 "2020-05-06T10:08:57Z")

</div>

Unfortunately there is a bug that results in this error, and not something you are doing wrong.

> <https://github.com/eclipse/deeplearning4j/issues/7855>
>
> I trying to run org.deeplearning4j.examples.nlp.glove.GloVeExample#main, as is, …from repository:
> 
> Glove glove = new Glove.Builder()
> .iterate(iter)
> .tokenizerFactory(t)
> 
> 
> .alpha(0.75)
> .learningRate(0.1)
> 
> // number of epochs for training
> .epochs(25)
> 
> // cutoff for weighting function
> .xMax(100)
> 
> // training is done in batches taken from training corpus
> .batchSize(1000)
> 
> // if set to true, batches will be shuffled before training
> .shuffle(true)
> 
> // if set to true word pairs will be built in both directions, LTR and RTL
> .symmetric(true)
> .build();
> 
> glove.fit();
> 
> And get:
> 
> \`
> "C:\\Program Files\\Java\\jdk1.8.0\_202\\bin\\java.exe" -agentlib:jdwp=transport=dt\_socket,address=127.0.0.1:62292,suspend=y,server=n -javaagent:C:\\Users\\abolotov\\.IntelliJIdea2018.2\\system\\groovyHotSwap\\gragent.jar -javaagent:C:\\Users\\abolotov\\.IntelliJIdea2018.2\\system\\captureAgent\\debugger-agent.jar=file:/C:/Users/abolotov/AppData/Local/Temp/capture1287.props -Dfile.encoding=UTF-8 -classpath C:\\Users\\abolotov\\AppData\\Local\\Temp\\classpath189535261.jar org.deeplearning4j.examples.nlp.glove.GloVeExample
> Connected to the target VM, address: '127.0.0.1:62292', transport: 'socket'
> o.n.l.f.Nd4jBackend - Loaded \[CpuBackend\] backend
> o.n.n.NativeOpsHolder - Number of threads used for NativeOps: 6
> o.n.n.Nd4jBlas - Number of threads used for BLAS: 6
> o.n.l.a.o.e.DefaultOpExecutioner - Backend used: \[CPU\]; OS: \[Windows 10\]
> o.n.l.a.o.e.DefaultOpExecutioner - Cores: \[6\]; Memory: \[7.0GB\];
> o.n.l.a.o.e.DefaultOpExecutioner - Blas vendor: \[MKL\]
> o.d.m.s.SequenceVectors - Starting vocabulary building...
> o.d.m.w.w.VocabConstructor - Sequences checked: \[97162\], Current vocabulary size: \[242\]; Sequences/sec: \[174125.45\];
> o.d.m.e.l.WordVectorSerializer - Projected memory use for model: \[0.18 MB\]
> o.d.m.e.i.InMemoryLookupTable - Initializing syn1...
> o.d.m.s.SequenceVectors - Building learning algorithms:
> o.d.m.s.SequenceVectors - building ElementsLearningAlgorithm: \[GloVe\]
> o.d.m.e.l.i.e.GloVe - GloVe params: {Max Memory: \[0\], Learning rate: \[0.1\], Alpha: \[0.75\], xMax: \[100.0\], Symmetric: \[true\], Shuffle: \[true\]}
> o.d.m.g.AbstractCoOccurrences - Actual memory limit: \[7559184384\]
> o.d.m.g.AbstractCoOccurrences - Number of word pairs saved so far: \[47194\]
> o.d.m.g.AbstractCoOccurrences - CoOccurrences map was built.
> o.d.m.s.SequenceVectors - Starting learning process...
> Exception in thread "VectorCalculationsThread 0" java.lang.RuntimeException: java.lang.UnsupportedOperationException
> at org.deeplearning4j.models.sequencevectors.SequenceVectors$VectorCalculationsThread.run(SequenceVectors.java:1341)
> Caused by: java.lang.UnsupportedOperationException
> at org.deeplearning4j.models.embeddings.learning.impl.elements.GloVe.learnSequence(GloVe.java:137)
> at org.deeplearning4j.models.sequencevectors.SequenceVectors.trainSequence(SequenceVectors.java:399)
> at org.deeplearning4j.models.sequencevectors.SequenceVectors$VectorCalculationsThread.run(SequenceVectors.java:1274)
> \`

Edit:  
After internal discussion we have decided to actually remove the GloVe functionality in the next release. It was broken for a long time now, and always had the problem that for a vocabulary of size N you need to create an NxN matrix. This quickly becomes unusable for many people as they either don’t have enough memory, or because it becomes too slow.

We support newer and better methods these days, so no one should be missing this feature.
