8

FUCK YOU PYTHON. Why you do that to me, uh?
I was using a CNN to classify hand poses and the prediction was not working at all, one class was given 100% all the time. After much investigation, I found the culprit... A FUCKING INDENT was messing my data. Normalization was inside the loop and not outside, so my pixel values were wayyyyy too small...
Also, I'm really dumb, I should have started with making sure everything was right before trying to fiddle with my architecture..
Anyway, it is working now, you can it out here if you want! https://github.com/MrEliptik/...

Comments
  • 3
    Nice advertisement..
  • 1
    @irene definitely!
  • 1
    Would indents-as-spaces and dotted visible spaces help here? noob sry
  • 0
    @slhd probably. I use 4 spaces for identify but forgot to configure visualisation on my new config.
    Also I could have taken a closer look at my code first, before losing time on the network 😅
  • 1
    What about lint your code ?
  • 1
    Use an IDE next time, like the built-in one, IDLE?
  • 0
    @vane @Parzi yes I'm using VSCode it wasn't fully setup on my new Linux partition
  • 0
    @SanitizedOutput
    http://pylint-messages.wikidot.com/...
    Well after quick test and look up.
    Pylint gives clear warning with line and message about indentation.

    ex. messages
    W: 2, 0: Bad indentation. Found 3 spaces, expected 4 (bad-indentation)
    W: 8, 0: Found indentation with tabs instead of spaces (mixed-indentation)
  • 0
    @SanitizedOutput lol read the message I pasted above as an example
  • 0
    @SanitizedOutput why you want to detect something like this ?
    That’s stupid.
  • 0
    @SanitizedOutput ok I see your point that the code is more clear with brackets because it shows you when the statement ends.
    But it doesn’t prevent you to put those statements below bracket.

    I personally disagree that python is for beginners just because it have bigger power with less code and it’s popular.

    I hate those one file scripts with 1k+ lines without any class. Just because you can do it doesn’t mean you have to do it.

    For beginners I would recommend any strong typed language with lots of code to write.
    “With great power comes great responsibility” - spiderman
  • 0
    PyCharm, Pep8 and PyLint to the rescue. They all scream and freak out when anything isn't indented properly and including them in your VCS push flow is even better. Won't be able to push with indent issues.
  • 0
    @SanitizedOutput on the other hand you can’t write
    ‘’’
    while(some very long if){stmt1()
    stmt2()}
    stmt3()
    ‘’’
    so I like enforcing indentation and think when I write then dealing with this shit.
    Some people don’t care if you don’t force them to.

    But that’s probably people problem not language problem 🙂
  • 0
    @SanitizedOutput auto formatting is waste of machine time
Add Comment