• Register
0 votes
2k 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

Please log in or register to answer this question.

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 10 views
10 views
Problem: HELP: deprecationwarning: elementwise == comparison failed; this will raise an error in the future.
asked Mar 14 Wafa Abu Yousef 6.1k points
0 votes
1 answer 223 views
223 views
Problem: np.nan is an invalid document, expected byte or unicode string.
asked Feb 21 charles mathews 5.5k points
1 vote
1 answer 6 views
6 views
Problem : I am tring to install numpy for windows 10 but I get his Error : Importing the multiarray numpy extension module failed How can i install numpy And aboid this.
asked Mar 12 Shovo210 13.2k points
0 votes
1 answer 80 views
80 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, 2020 mphil 2.3k points
0 votes
1 answer 2 views
2 views
Problem: Can anyone tell me the solution of this problem? notfittederror: countvectorizer - vocabulary wasn't fitted.
asked 4 days ago Ifra 24.4k points
0 votes
1 answer 2 views
2 views
Problem: I need someone’s help to fix it .. python machine learning alphabet and digits recognition
asked 4 days ago Ifra 24.4k points
0 votes
1 answer 2 views
2 views
Problem: Can anyone help me? I am having a hard time knowing the difference between these: from sklearn.model_selection import train_test_split from sklearn.cross_validation import train_test_split
asked Mar 23 ummesalma 22.9k points
0 votes
1 answer 4 views
4 views
Problem: Any ideas on what I need to do to fix this? Thanks!
asked Mar 21 ummesalma 22.9k points
1 vote
1 answer 1K views
1K 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, 2020 stewart 4k points
0 votes
1 answer 9 views
9 views
Problem: I have this error, and I need to fix it, any help: the truth value of an array with more than one element is ambiguous. use a.any() or a.all()
asked Mar 14 Wafa Abu Yousef 6.1k points