-1

I am running the code to train multi class and im getting the error too many values to unpack using the yelp dataset python DNN for sentiment analysis.

(reviews_words_index, labels) = pickle.load(open("review_sents_1859888.pkl", 'rb'))

but i get en error

ValueError: too many values to unpack.
Brown Bear
  • 19,655
  • 10
  • 58
  • 76
Susheel
  • 61
  • 1
  • 1
  • 4

1 Answers1

0

Read anything on tuple-unpacking, e.g. this.

So in your case, do:

my_data = pickle.load(open("review_sents_1859888.pkl", 'rb'))
print(len(my_data))
# e.g. 4

Then you can unpack this with the right number of variables on the left:

a, b, c, d = pickle.load(open("review_sents_1859888.pkl", 'rb'))

So it basically seems that this object is not exactly setup like you expect it to be!

sascha
  • 32,238
  • 6
  • 68
  • 110
  • Hi Thanx for your reply, when i am trying to find the length i got the value '1013951' and i got the following error IndexError: index -2147483649 is out of bounds for axis 1 with size 5 – Susheel Sep 02 '17 at 10:32