简体   繁体   中英

Python Tensorflow ValueError: too many values to unpack

I am new to Tensorflow. I tried to put tensor list into the tf.train.batch() function, but I got an ValueError (too many values to unpack (expected 2)) . Here is my code, and the error is from the second line.

g = tf.unstack(data, num = 60366, axis = 0)
X_mb, _ = tf.train.batch(g, 32, capacity = 60366)

My data is a [60366, 39] matrix.

Can someone help me? Thx!

Looks like you need this:

X_mb, *_ = tf.train.batch(g, 32, capacity = 60366)

or this:

X_mb = tf.train.batch(g, 32, capacity = 60366)[0]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM