0

I followed a CNN classification example on this link https://towardsdatascience.com/malware-classification-using-convolutional-neural-networks-step-by-step-tutorial-a3e8d97122f

I did look at the previous questions posted and i tried adding .any() and .all() on all numpy arrays that I can see but still couldn't solve the issue. What can I do?

Screenshot of the problem

  • Welcome to Stack Overflow. See how the error message is pointing at a line that says `class_weight`, in the library code? Do you see something called `class_weight` in your code? I do: the keyword argument `class_weight=class_weights`. Is that a Numpy array? If it is, do you see how that would cause a problem for the code that says `if class_weight:`, based on what you already read in those questions? Did you try to **read the documentation** for the library function you are calling, in order to understand what should be passed for `class_weight`? – Karl Knechtel Sep 22 '22 at 02:22
  • Anyway, for future reference, please read [ask] and [mre] and https://ericlippert.com/2014/03/05/how-to-debug-small-programs/ and https://meta.stackoverflow.com/questions/261592, and [do not upload images of errors when asking a question.](//meta.stackoverflow.com/q/285551) Instead, copy and paste the [complete](https://meta.stackoverflow.com/questions/359146) error message, starting from the line that says `Traceback (most recent call last):`, and [format](https://stackoverflow.com/help/formatting) it like code. – Karl Knechtel Sep 22 '22 at 02:23
  • @KarlKnechtel thanks alot! i did, but nothing i do is working. i did read the documentation but it was so frustrating at that time that i didnt really focus. i did try to run this code on windows pc, works with no issues. – Amier Asyraf Sep 22 '22 at 13:52
  • @KarlKnechtel thanks for the second comment, i really appreciate it, helps a ton for newbies like me! – Amier Asyraf Sep 22 '22 at 13:53

0 Answers0