question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ValueError: too many values to unpack

See original GitHub issue
Traceback (most recent call last):
  File "main.py", line 168, in <module>
    inference_data = inference_data_loader(FLAGS)
  File "/home/ubuntu/SRGAN-tensorflow/lib/model.py", line 210, in inference_data_loader
    image_LR = [preprocess_test(_) for _ in image_list_LR]
  File "/home/ubuntu/SRGAN-tensorflow/lib/model.py", line 202, in preprocess_test
    h, w = im.shape
ValueError: too many values to unpack

What’s this error caused by, and how do I resolve it?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
ProGamerGovcommented, Dec 6, 2017

To solve this issue in another project, I used code like this:

import scipy.ndimage as spi

spi.imread(org_content, mode="RGB").astype(float)/256

to make sure that every input image was read as an RGB image.

My fix used the scipy library:

sudo pip install scipy

Source: https://docs.scipy.org/doc/scipy-0.18.1/reference/generated/scipy.misc.imread.html

Maybe something like my fix with scipy, could work for SRGAN-tensorflow?

0reactions
Martan404commented, May 29, 2018

Fix here #17

Read more comments on GitHub >

github_iconTop Results From Across the Web

ValueError: too many values to unpack (expected 2)
This error occurs when the number of variables doesn't match the number of values. As a result of the inequality, Python doesn't know...
Read more >
Python valueerror: too many values to unpack (expected 2)
The “valueerror: too many values to unpack (expected 2)” error occurs when you do not unpack all the items in a list. This...
Read more >
Python ValueError: too many values to unpack - Stack Overflow
To fix this, you can iterate explicitly over the items of the dict, which are the (key, value) pairs that you seem to...
Read more >
ValueError: too many values to unpack (expected 2)
Python ValueError: too many values to unpack, occurs during a multiple-assignment where you either don't have enough objects to assign to the variables...
Read more >
[Solved] Valueerror: Too Many Values to Unpack (Expected 2)
These multiple values returned by functions can be stored in other variables. 'Python valueerror: too many values to unpack (expected 2)' occurs ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found