nateraw / Lda2vec-Tensorflow

Tensorflow 1.5 implementation of Chris Moody's Lda2vec, adapted from @meereeum
MIT License
107 stars 40 forks source link

ValueError: not enough values to unpack (expected 7, got 6) #44

Closed dbl001 closed 5 years ago

dbl001 commented 5 years ago

In run_20newsgroups.py:

When load_embeds=False, utils.load_preprocessed_data() gets an exception unpacking the results:

load_embeds = False

# Load data from files
(idx_to_word, word_to_idx, freqs, pivot_ids,
 target_ids, doc_ids, embed_matrix) = utils.load_preprocessed_data(data_path, load_embed_matrix=load_embeds)

ValueError Traceback (most recent call last)

in () 8 # Load data from files 9 (idx_to_word, word_to_idx, freqs, pivot_ids, ---> 10 target_ids, doc_ids, embed_matrix) = utils.load_preprocessed_data(data_path, load_embed_matrix=load_embeds) 11 12 # Number of unique documents ValueError: not enough values to unpack (expected 7, got 6)
nateraw commented 5 years ago

That function will not return embed_matrix when load_embed_matrix=False. Use it like this:

load_embeds = False

# Load data from files
(idx_to_word, word_to_idx, freqs, pivot_ids,
 target_ids, doc_ids) = utils.load_preprocessed_data(data_path, load_embed_matrix=load_embeds)