Detectron: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Created on 24 Jan 2018  Â·  7Comments  Â·  Source: facebookresearch/Detectron

node = self.represent_data(data)

File "/usr/local/lib/python2.7/dist-packages/yaml/representer.py", line 61, in represent_data
node = self.yaml_multi_representersdata_type
File "/usr/local/lib/python2.7/dist-packages/yaml/representer.py", line 447, in represent_object
return self.represent_mapping(tag+function_name, value)
File "/usr/local/lib/python2.7/dist-packages/yaml/representer.py", line 123, in represent_mapping
node_value = self.represent_data(item_value)
File "/usr/local/lib/python2.7/dist-packages/yaml/representer.py", line 57, in represent_data
node = self.yaml_representersdata_types[0]
File "/usr/local/lib/python2.7/dist-packages/yaml/representer.py", line 223, in represent_dict
return self.represent_mapping(u'tag:yaml.org,2002:map', data)
File "/usr/local/lib/python2.7/dist-packages/yaml/representer.py", line 123, in represent_mapping
node_value = self.represent_data(item_value)
File "/usr/local/lib/python2.7/dist-packages/yaml/representer.py", line 41, in represent_data
if self.ignore_aliases(data):
File "/usr/local/lib/python2.7/dist-packages/yaml/representer.py", line 142, in ignore_aliases
if data in [None, ()]:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Most helpful comment

yes, just update the yaml to version 3.12 will solve the problem.
PyYAML-3.12: http://pyyaml.org/download/pyyaml/PyYAML-3.12.zip.
unzip PyYAML-3.12.zip
cd PyYAML-3.12
python setup.py install

All 7 comments

Hi @gaopeng-eugene, which versions of numpy and yaml are you using? We recommend using numpy version 1.13 and yaml version 3.12.

yes, just update the yaml to version 3.12 will solve the problem.
PyYAML-3.12: http://pyyaml.org/download/pyyaml/PyYAML-3.12.zip.
unzip PyYAML-3.12.zip
cd PyYAML-3.12
python setup.py install

Thanks @ir413 and thanks for confirming @tshizys.

I have the same problem but I have yaml with 3.12 version and numpy with 1.14 version, so I suppose that I install numpy 1.13? Thanks.

Hi! I have the same problem.
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
I have installed numpy 1.13 and pyyaml 3.12 in my conda environment. It still shows the same error even if the version of numpy and pyyaml has been changed.

Is there any other ways to solve this value error?

@sararojas I have the same problem and use numpy1.14. Did you solve the problem?
Thanks a lot!

yes, but I realized that the problem wasn't numpy, the real issue always was yaml... basically, detectron never could find yaml with the last version... at the end, I decided use a docker... but at this moment I'm using detectron with pytorch. it's easy and I recommended you!!!

On Jul 27, 2018 10:56 PM, Chong Zhang notifications@github.com wrote:

@sararojashttps://github.com/sararojas I have the same problem and use numpy1.14. Did you solve the problem?
Thanks a lot!

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/facebookresearch/Detectron/issues/23#issuecomment-408585236, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ALAsojOHtkqvJsRKssyanyVJDuX6JZcgks5uK_z8gaJpZM4RrFEq.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

twmht picture twmht  Â·  3Comments

Hwang-dae-won picture Hwang-dae-won  Â·  3Comments

kleingeo picture kleingeo  Â·  3Comments

743341 picture 743341  Â·  4Comments

elfpattern picture elfpattern  Â·  3Comments