ValueError: too many values to unpack
See original GitHub issueTraceback (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:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
To solve this issue in another project, I used code like this:
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?Fix here #17