1
votes
def load_data(dataset='data.pkl.gz'):
      dataset = os.path.join(os.path.split(__file__)[0], '../data', dataset)
      f = gzip.open(dataset, 'rb')
      train_set, valid_set, test_set = pickle.load(f)
      f.close()

when I want to call this file (load_data) in another file, I get this error message.

in load_data

train_set, valid_set, test_set = pickle.load(f)

ValueError: too many values to unpack (expected 3)

1
What do you get if you try print(pickle.load(f))? - Patrick Haugh
@whackamadoodle3000 "Too many values..." implies that pickle.load(f) unpacks to more than three values - Patrick Haugh
Oops, you're right. - whackamadoodle3000
nothing appears when I print(pickle.load(f)) @PatrickHaugh so what should i do? - V.O Vian
inside the load_data file I also create def make_numpy_array (data_xy): which will to make train_set, valid_set, test_set - V.O Vian

1 Answers

0
votes

your load function returns less values, so try to delete one of the variable at the receiving end..