# Beta 7 - Glove Word Vector

**URL:** <https://community.konduit.ai/t/beta-7-glove-word-vector/540>\
**Category:** DL4J\
**Created:** [May 19, 2020, 4:28am UTC](https://community.konduit.ai/t/beta-7-glove-word-vector/540 "2020-05-19T04:28:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sundarssp](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@sundarssp](https://community.konduit.ai/u/sundarssp)\
**Post date:** [May 19, 2020, 4:28am UTC](https://community.konduit.ai/t/beta-7-glove-word-vector/540/1 "2020-05-19T04:28:37Z")

</div>

Hi

We were using DL4J Beta6 version to load Glove 300d word vector file. It stopped working after upgrading to beta7. I posted this same question in Gitter and was given this commit history  
[Remove GloVe (#437) · eclipse/deeplearning4j@2cdb2b3 · GitHub](https://github.com/eclipse/deeplearning4j/commit/2cdb2b344704956098d97a422df8aacff384a024).

Seems the support for Glove was removed in Beta7. Is that the case?

However the beta7 documentation shows the file can be loaded using the loadTxtVectors method.

[https://deeplearning4j.konduit.ai/language-processing/word2vec#glove-global-vectors](https://deeplearning4j.konduit.ai/language-processing/word2vec#glove-global-vectors)

I did try that. It takes forever, even for the 50d file. It doesn’t load at all. I did try few other methods in the WordVectorSerializer class. None of those worked.

Please suggest if there are any workarounds.

Thanks.

---

<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 19, 2020, 5:05am UTC](https://community.konduit.ai/t/beta-7-glove-word-vector/540/2 "2020-05-19T05:05:57Z")

</div>

We have removed the support for _creating_ new Glove based word vector files. However, once they are created there is no difference between a word vector file that was created by word2vec and glove, so loading them should not be affected.

Can you share more details about your System and how big your glove file is?

---

<div class="post-metadata">

**Author:** ![sundarssp](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@sundarssp](https://community.konduit.ai/u/sundarssp)\
**Post date:** [May 19, 2020, 5:40am UTC](https://community.konduit.ai/t/beta-7-glove-word-vector/540/3 "2020-05-19T05:40:58Z")

</div>

Hello,

Thanks for the quick response. I tried in different configurations. Some configs below

- Xeon 4 Core, 32 GB RAM, Jdk 8, Windows 10
- Core i7 4 Core Hyperthreading (8 logical cores), 16 GB RAM, Jdk 8, Windows 10  
File detail - glove.6B.50d.txt (167 MB), glove.6B.100d.txt (338 MB), glove.6B.300d.txt (1 GB). All files are text files.

If I switch back to beta 6, glove.6B.50d.txt file loads in about 5 seconds. In beta 7 it doesn’t load at all. Program is just a single line

WordVectors wordVectors = WordVectorSerializer.readWord2VecModel(new File(“glove.6B.50d.txt”));

---

<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 19, 2020, 6:40am UTC](https://community.konduit.ai/t/beta-7-glove-word-vector/540/4 "2020-05-19T06:40:31Z")

</div>

It looks like you have stumbled upon a bug in beta7.

As a workaround, you can load the file in beta6 and then save it as a binary in dl4j format like this:

```auto
Word2Vec wordVectors = WordVectorSerializer.readWord2VecModel(new File("glove.6B.50d.txt"));
WordVectorSerializer.writeWord2VecModel(wordVectors, new File("glove.bin"));

```

And then you can reload the binary in beta7:

```auto
Word2Vec wordVectors = WordVectorSerializer.readWord2VecModel(new File("glove.bin"));

```

We have filed an issue for the underlying problem: [ND4J: concat op fails with 3073 or more inputs on CPU · Issue #8961 · eclipse/deeplearning4j · GitHub](https://github.com/eclipse/deeplearning4j/issues/8961)

Edit: It appears to be a problem with the mkldnn implementation. If you don’t want to go back and forth between versions, you can also disable mkldnn with `Nd4j.getEnvironment().allowHelpers(false);` before loading and save the file in another format that way.
