• Register
0 votes
1.4k views

Problem :

I am finding solution on following issue
deprecationwarning: elementwise == comparison failed; this will raise an error in the future.
6 5 3
6,930 points

1 Answer

0 votes

Solution :

I guess the error occurs in this expression:

np.sum(np.argmax(predictions, 1) == np.argmax(labels, 1))

In numpy you can compare arrays of the same size only  but it is treaky when it comes to comparing arrays that do not match in size:

e.g.

In [522]: np.arange(10)==np.arange(5,15)
Out[522]: array([False, False, False, False, False, False, False, False, False, False], dtype=bool)
In [523]: np.arange(10)==np.arange(5,14)
/usr/local/bin/ipython3:1: DeprecationWarning: elementwise == comparison failed; this will raise an error in the future.
  #!/usr/bin/python3
Out[523]: False
9 7 4
38,600 points

Related questions

0 votes
1 answer 44 views
44 views
Problem : I am new to python. I have tried to install below softwares: Python 2.5.4, Numpy 1.5.0 win32, Matplotlib 1.0.0 win32, pywin32 218. After doing so much of hard work I am still unable to plot the graphs in Python. I am facing ... > from matplotlib._path import affine_transform ImportError: DLL load failed: The specified module could not be found. Can somebody help me in fixing this error?
asked Feb 22 mphil 2.3k points
0 votes
2 answers 1.5K views
1.5K views
Problem : I got following rather cryptic error message: the truth value of an array with more than one element is ambiguous. use a.any() or a.all()
asked Nov 18, 2019 peterlaw 6.9k points
1 vote
1 answer 747 views
747 views
Problem : I am very beginner to Tensorflow. I am trying to use the Tensorflow from past couple of days. Now I am trying to install it and again reinstalling it again and again in my python2.7 and 3.4. But after doing so many installations I am still facing below ... for your reference: tf_in = tf.placeholder("float", [None, A]) # Features I need urgent help to fix above strange looking error.
asked Apr 29 stewart 4k points
1 vote
1 answer 499 views
499 views
Problem : Currently I am learning r. I have the data table "normal" which has the numeric as far as I know normalized values. If I try to execute the below command k <- kmeans(normal,center=3) Then I always face the below error: &ldquo;Error in do_one(nmeth) : NA/NaN/ ... call (arg 1)&rdquo; I am trying to fix it by researching on it but still unable to fix it. Can somebody help me in fixing it?
asked Mar 28 morrisBson 3.2k points