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.

need more than 1 value to unpack

See original GitHub issue

Hey guys, when I run inference with ipyn (VOCpascal) I get this error:

`--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-6-f56c15ba16bb> in <module>() ----> 1 image_batch, outputs = next(test_generator) 2 image = image_batch[0, …].copy() 3 image -= min(image.flatten()) 4 image /= max(image.flatten()) 5 image *= 255

/usr/local/lib/python2.7/dist-packages/keras_retinanet/preprocessing/pascal_voc.pyc in next(self) 179 # lock indexing to prevent race conditions 180 with self.lock: –> 181 selection, _, batch_size = next(self.index_generator) 182 183 result = self._get_batches_of_transformed_samples(selection)

ValueError: need more than 1 value to unpack`

the initialization of data throws no error, actually gives no feedback at all, but I think its fine. path should be correct, test.txt exists and contains just one line: the name of the image (without .jpg)

I saw here that someone had kind of the same error. downgrading to keras 2.0.8 throws a new error at a prior step, so I would like to avoid that. I think I have all the changes from the PR mentioned in the other issue.

Any ideas or advice or workarounds?

versions: python 2.7.6 keras 2.0.9

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
nealzGucommented, Nov 8, 2017

ahhhh right, that thing. thanks again, everything is working fine now. you helped me a lot 😃

0reactions
hgaisercommented, Nov 8, 2017

By default python will use the version from your /usr/ directory. You can run your programs with PYTHONPATH=/path/to/your/cloned/keras-retinanet python examples/train_pascal.py. This will make python have a preference of using your local (non-installed) copy.

unrelated: it is working now (at least not throwing errors). I trained outside of the ipyn and want to run inference now. If I wanna use the ipyn, I just skip the “train on data” part, right? But don’t I skip the “load pretrained weights” part in this case as well?! Sorry, different topic, I will close this thread directly afterwards 😃

Yeah exactly. If you change the weights parameter when creating the model to point to your saved model, it should use those weights. ie.:

model = keras_retinanet.models.ResNet50RetinaNet(image_input, num_classes=20, nms=True, weights='snapshots/resnet50_voc_best.h5')
Read more comments on GitHub >

github_iconTop Results From Across the Web

Python Error: "ValueError: need more than 1 value to unpack"
youre getting ''ValueError: need more than 1 value to unpack'', because you only gave one value, the script (which is ex14.py in this...
Read more >
ValueError: need more than 1 value to unpack? - Blender Artists
During a multiple value assignment, the ValueError: need more than 2 values to unpack occurs when either you have fewer objects to assign...
Read more >
Easy Fix to ValueError: Need More than 1 Value to Unpack
The valueError: need more than 1 value to unpack is the valueError which usually occurs during a multiple value assignment. It generally occurs ......
Read more >
need more than 1 value to unpack' in Python - Quora
Your problem is that the value of line has no spaces. So line.split() outputs one value where you expect 2. Assuming your input...
Read more >
Need more than 1 value to unpack - Episode Support
This error can occur for multiple reasons. The most common of which include: Incorrect use of weather effects with backgrounds.
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