# Issue with GloVe

**URL:** <https://discuss.pytorch.org/t/issue-with-glove/40516>\
**Category:** Uncategorized\
**Created:** [March 21, 2019, 12:34pm UTC](https://discuss.pytorch.org/t/issue-with-glove/40516 "2019-03-21T12:34:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rohan\_Kumar](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/rohan_kumar/32/10228_2.png) [@Rohan\_Kumar](https://discuss.pytorch.org/u/Rohan_Kumar)\
**Post date:** [March 21, 2019, 12:34pm UTC](https://discuss.pytorch.org/t/issue-with-glove/40516/1 "2019-03-21T12:34:50Z")

</div>

I built the the vocab using torchtext and GloVe representation. My dataset consisted of Tweet and the Target (Hilary Clinton, Climate Change, Atheism etc) and I wanted to print those again after creating the iterator but I got a weird output.

```auto
TEXT.build_vocab(trn, min_freq = 2, vectors=GloVe(name='6B', dim=300))
vectors=GloVe(name='6B', dim=300)
train_iterator, test_iterator = BucketIterator.splits((trn,tst), batch_size= Batch_size, device = device)

```

```auto
for i,batch in enumerate(train_iterator):
    x = batch.target.numpy()
    l = []
    for i in x.T:
        for j in i:
            l.append(vectors.itos[j])
            #print(vectors.itos[j])
        print(l)
        break

```

> [‘.’, ‘on’, ‘with’, ‘of’, ‘,’, ‘,’, ‘,’, ‘,’]  
> [‘.’, ‘said’, ‘it’, ‘of’, ‘,’, ‘,’, ‘,’, ‘,’]  
> [‘.’, ‘said’, ‘it’, ‘of’, ‘,’, ‘,’, ‘,’, ‘,’]  
> [‘.’, ‘said’, ‘it’, ‘of’, ‘,’, ‘,’, ‘,’, ‘,’]  
> [‘.’, ‘said’, ‘it’, ‘of’, ‘,’, ‘,’, ‘,’, ‘,’]  
> [‘.’, ‘on’, ‘with’, ‘of’, ‘,’, ‘,’, ‘,’, ‘,’]  
> [‘.’, ‘by’, ‘"’, ‘is’, ‘of’, ‘,’, ‘,’, ‘,’]

I got this instead of the targets, What is wrong with the code? or will it simply be like this?

---

<div class="post-metadata">

**Author:** ![Rohan\_Kumar](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/rohan_kumar/32/10228_2.png) [@Rohan\_Kumar](https://discuss.pytorch.org/u/Rohan_Kumar)\
**Post date:** [March 21, 2019, 1:57pm UTC](https://discuss.pytorch.org/t/issue-with-glove/40516/2 "2019-03-21T13:57:13Z")

</div>

The problem is solved  
by using

```auto
vectors = TEXT.vocab

```

instead of

```auto
vectors = GloVe(....)

```
