Detectron: run infer_simple ValueError: too many values to unpack

Created on 23 Jan 2019  ·  3Comments  ·  Source: facebookresearch/Detectron

python tools/infer_simple.py --cfg configs/12_2017_baselines/e2e_mask_rcnn_R-101-FPN_2x.yaml --output-dir /tmp/detectron-visualizations --image-ext jpg --wts https://dl.fbaipublicfiles.com/detectron/35861858/12_2017_baselines/e2e_mask_rcnn_R-101-FPN_2x.yaml.02_32_51.SgT4y1cO/output/train/coco_2014_train:coco_2014_valminusminival/generalized_rcnn/model_final.pkl demo/17790319373_bd19b24cfc_k.jpg
/usr/local/lib/python2.7/dist-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters
Found Detectron ops lib: /home/ubuntu/ai/facebook/pytorchtem/pytorch/build/lib/libcaffe2_detectron_ops_gpu.so
[E init_intrinsics_check.cc:43] CPU feature avx is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
WARNING cnn.py: 25: [====DEPRECATE WARNING====]: you are creating an object from CNNModelHelper class which will be deprecated soon. Please use ModelHelper object with brew module. For more information, please refer to caffe2.ai and python/brew.py, python/brew_test.py for more information.
INFO net.py: 51: Loading weights from: /tmp/detectron-download-cache/model_final.pkl
[I net_dag_utils.cc:102] Operator graph pruning prior to chain compute took: 0.00017763 secs
[I net_dag_utils.cc:102] Operator graph pruning prior to chain compute took: 0.00015202 secs
[I net_dag_utils.cc:102] Operator graph pruning prior to chain compute took: 1.4268e-05 secs
INFO infer_simple.py: 147: Processing demo/17790319373_bd19b24cfc_k.jpg -> /tmp/detectron-visualizations/17790319373_bd19b24cfc_k.jpg.pdf
[I net_async_base.h:211] Using specified CPU pool size: 4; device id: -1
[I net_async_base.h:216] Created new CPU pool, size: 4; device id: -1
[I net_async_base.h:211] Using specified CPU pool size: 4; device id: -1
[I net_async_base.h:216] Created new CPU pool, size: 4; device id: -1
Traceback (most recent call last):
File "tools/infer_simple.py", line 185, in
main(args)
File "tools/infer_simple.py", line 153, in main
model, im, None, timers=timers
ValueError: too many values to unpack

Most helpful comment

For me, I found that using opencv-python 3.2.0.7 fixed the issue.

All 3 comments

For me, I found that using opencv-python 3.2.0.7 fixed the issue.

I had the same problem with the docker image and solved it with:
pip install opencv-python==3.2.0.7

Hi all, as @sairams-intel and @darianfrajberg suggested, the issue is likely caused by different findContours signatures across OpenCV versions. This compatibility issue was addressed recently in b05209367a207949ce3421a1d512e6d05e82db8b. Please retry with latest master and reopen the issue if the problem is still present.

Was this page helpful?
0 / 5 - 0 ratings