Testing self driving neural network model - Python plays GTA p.12

Поділитися
Вставка
  • Опубліковано 18 гру 2024

КОМЕНТАРІ • 74

  • @VladGMuriii
    @VladGMuriii 7 років тому +29

    man i cant tell you how is this getting me so stoked
    i will start a bachelor degree in computer science and i cant wait :)

    • @herp_derpingson
      @herp_derpingson 7 років тому +8

      As someone who is nearing the end of the bachelors degree, I can tell you it is really disappointing. But, you gotta do it anyways because most companies wont hire you otherwise.
      However, it does not mean you cant learn cool stuff from the internet. Have fun :)

    • @ChikitoPOWA
      @ChikitoPOWA 7 років тому +6

      My advice, do it in your free time. I'm doing something quite similar to ComputerScience(but I'm french so..) and nobody is showing you something interesting, you may learn the basis, but the most important, the experience, you will have to learn it alone!
      And I took way too much time to find this out, so, start it right now, take python/C/java/... I don't care, but do something, try it, and this will really bring you something.
      Look Sentex's Q&A, he explain it better than me!

    • @VladGMuriii
      @VladGMuriii 7 років тому +2

      atm i am studying for my final exams which are crucial for my application.
      But i am going to study python/java before uni and try to do some projects

  • @mk-uj7vi
    @mk-uj7vi 7 років тому +1

    Absolutely enjoy watching your videos. Thanks.

    • @sentdex
      @sentdex  7 років тому

      Great to hear!

  • @Bodzilla001
    @Bodzilla001 7 років тому +1

    I'm in love with the damn train - Big Smoke

  • @radeck2007
    @radeck2007 7 років тому +17

    Is it possible that "he" want to turn left and right all the time because of equal training data for forward, left and right? Maybe it is ok to have a little bit more forward training data?

    • @tuhinmukherjee8141
      @tuhinmukherjee8141 3 роки тому +1

      Maybe, yes. The fact that the highway is mostly straight is just a bias we need to account for. Forcefully removing it might be take a toll on accuracy.

  • @deepkushagra
    @deepkushagra 6 років тому +6

    Does it mean that when we drive a Tesla car, it collect data to train self driving model?

  • @aldofernandosepulvedacue587

    it looks like you are teaching a kid how to ride a bike. SO excellent.

  • @akirarenbokoji4464
    @akirarenbokoji4464 7 років тому +7

    Question: So if you were to tackle a taxi mission would it go something like -
    1. Train data to pick up a mission
    2. Train data to check the map once a mission is accepted.
    3. Train data to do the mission.
    continue training data on specific tasks then combine it to be applied at a later time
    or
    Train data to pick up a mission and do all tasks required to complete it in one fell swoop. Then repeat until you have a large amount of training data.
    This is great fun and I'm learning tons.

    • @sentdex
      @sentdex  7 років тому +6

      Personally, I would just have it press the key for the taxi mission if no mission detected (not an AI task, just use open CV to see if theres a path on the map). From there, do the mission and follow all lines. For a taxi mission, there's a line to the client, and then a line to their destination. Once you're done, the process repeats.
      The hard part is knowing how "well" you've done, because different clients go different distances and those distances have a more or less challenging pathway there.

    • @akirarenbokoji4464
      @akirarenbokoji4464 7 років тому

      Thank you.

  • @jacobdavidcunningham1440
    @jacobdavidcunningham1440 7 років тому +4

    Wow it's really fascinating to think of the "algorithm" to drive. Things get larger as they approach you, left side (oncoming traffic) different speed, heading/waypoint, sky/ground, color difference/road boundary, awesome.
    edit: I also wonder if it's based on the frame rate of the game, the progression from each frames for computation. Not only would your computer have to be able to play the game but do the processing in real time to control the game. Not sure man that's nuts the pixel pixel analysis for figuring out what things are/direction/approaching/leaving... ray tracing? I don't know
    good luck and GOD SPEED!

  • @martinpalsson490
    @martinpalsson490 7 років тому

    Hi sentdex!
    Did you consider putting some kind of (median-) filter on the input to the ai (or the neural network)? Say, you save the 4 latest screens + the current one, compare values and send the median (or the screen corresponding to current median) to the ai (network)?
    I've done this on my own self driving RC-car, and it made it maneuver smoother. Less jitter in the input to the regulator. My setup was quite different though, only measuring distance to walls. What you could do is to calculate how far off the center of the lane you are.

  • @Raptors19tdot
    @Raptors19tdot 7 років тому

    Omg this is so freaking Cool!!! But damnnn so much work & thoughts put into it.

  • @festro1000
    @festro1000 5 років тому +1

    or avoid the police, probably a good way to do that would be to have the script detect the red and blue flash of nearby police, while turning on the rewad signal while out of their radar range and off when they're detected.

  • @felixbrumm9699
    @felixbrumm9699 7 років тому +32

    why do you remind me of snowden? XD

    • @sentdex
      @sentdex  7 років тому +18

      Maybe because we're related.

    • @felixbrumm9699
      @felixbrumm9699 7 років тому +9

      Illuminati confirmend

    • @JonathanACarr
      @JonathanACarr 5 років тому

      And he lives near a military base. Coincidence? I think not.

  • @TheOswald42
    @TheOswald42 7 років тому +1

    aha! getkeys, now I know how to pause my endless loop script without ctrl c, thanks Sentdex

    • @sentdex
      @sentdex  7 років тому +1

      Yeah, I got prettttttty tired of stopping, and then waiting for things to load back up. Aint got time fo dat.

  • @oneplusonetwo
    @oneplusonetwo 7 років тому

    what does it train exactly? find the relationship between image and keypress?
    also do you have to upload data to cloud or just train on local machine? and how long does it take?

  • @marcelburkhard
    @marcelburkhard 7 років тому

    You can disable the hud in the GTA V Trainer (the F4 thingy)

  • @tuhinmukherjee8141
    @tuhinmukherjee8141 3 роки тому

    Also, shouldn’t we have normalized the grayscale data , ie. subtract it by it’s mean and divide it by it’s standard deviation such that it becomes much easier for the model to work with it.

  • @doylerudolph7965
    @doylerudolph7965 7 років тому

    when you normalized the number of rights lefts and straights you set the max number of rights to the number of rights, which wasn't previously constrained, but instead used to constrain left and straight. if there were fewer rights than lefts, there is no issue, but if there were more rights in the training data, the network will be biased toward turning right.

  • @akirarenbokoji4464
    @akirarenbokoji4464 7 років тому

    Question: When did WIDTH & HEIGHT change from 80, 60 to 160, 120. Is this a preference change or something super important that I should be aware of. At the moment I only understand that 80, 60 is quite large for CNN. I'm assuming results were better increasing it to 160, 120?

    • @sentdex
      @sentdex  7 років тому +2

      I changed width and height when I introduced traffic. On 80x60, lane detection was super simple, it could have been even smaller. I rose to 160x120 when I brought in traffic, and have kept it since being in the city. It's totally possible you can get away with a lesser resolution. Just make sure you look at it yourself. Bring up the 80x60 image, make it full screen (but still 80x60), and see if YOU can see things or not. I felt like 160x120 was more reasonable for avoiding cars.

    • @akirarenbokoji4464
      @akirarenbokoji4464 7 років тому

      Thank you!!!

    • @ziyuefeng5355
      @ziyuefeng5355 7 років тому +1

      which version of tensorflow and tflearn do you use?
      I'm using tensorflow1.1.0 and tflearn0.3 , it always raise an error when running your code
      InvalidArgumentError (see above for traceback): Unsuccessful TensorSliceReader constructor: Failed to get matching files on

  • @England91
    @England91 7 років тому

    the map is part of the HUD in GTA if I'm not mistaken

  • @Lsoftproductions
    @Lsoftproductions 6 років тому +2

    training worked for me but when it comes to testing i get errors: Could not create cudnn handle: CUDNN_STATUS_ALLOC_FAILED
    Would anyone know how to fix that? I might try using a different version of CUDNN/CUDA

    • @shubhampaul6559
      @shubhampaul6559 6 років тому +1

      Add this...
      tflearn.init_graph(num_cores=4, gpu_memory_fraction=0.6)

    • @Lsoftproductions
      @Lsoftproductions 6 років тому +1

      thank you thank you :) i fixed it :P

    • @machwave540
      @machwave540 6 років тому

      @@Lsoftproductions how did you fix it?

    • @Lsoftproductions
      @Lsoftproductions 6 років тому

      i'm sorry , i don't remember haha XXXXX

  • @tuhinmukherjee8141
    @tuhinmukherjee8141 3 роки тому

    Hey, maybe we could take into account the machine learning model’s prediction you built before into account as well. Also, I feel that your forward, left and right functions are a little erroneous. I might be wrong.

  • @akirarenbokoji4464
    @akirarenbokoji4464 7 років тому

    I'm having trouble understanding what WIDTH and HEIGHT is for. I'm assuming its the shape of the tensors?
    If I increased the inputs from 3 [W, A, D] to 5 what would I have to update to reflect the changes or can I keep it as is and have the model fit? Would I have to change the WIDTH and HEIGHT?

    • @sentdex
      @sentdex  7 років тому +3

      width and height are the actual input data, it's the width and height of the image itself. You don't need to change width and height if you change the # of keys to press. If you change the # of key press options, then you need to just change the output layer of the network from 3 to 5, or whatever number of actions you want.

    • @akirarenbokoji4464
      @akirarenbokoji4464 7 років тому +1

      Thank you! WOW ITS SURREAL THAT YOU REPLIED TO MY COMMENT. It's gonna be a good day.

    • @akirarenbokoji4464
      @akirarenbokoji4464 7 років тому

      Sweeet. I don't know what I'm doing so I changed all the 3s in Alexnet to 5. It seems to have worked since my output is now 5 but I'm wondering... what I shouldn't have changed. I'm going to attempt to read docs and if that fails just change one at a time to see what happens. Thank you so much for not only the inspiration but a very detailed tutorial that is easy to understand.

  • @wolfgtweb
    @wolfgtweb 6 років тому

    I know this is an old series and you may have done this already, but I see the Windows shake feature has screwed you a couple times during this series. You can disable that feature pretty easily if you don't legitimately use it. Just a thought. Also, you might want to check out a little program called UltraMon. You would really like the monitor management features. I enjoy your videos, keep up the great work.

  • @GursehajSinghArora
    @GursehajSinghArora 7 років тому

    Instead of going for direct WASD, use analog values as given by joystick which makes it go left or right smoothly and use PID for the turns.

  • @CarterColeisInfamous
    @CarterColeisInfamous 7 років тому +1

    Where are you in Texas? Im from Houston

  • @lionkor98
    @lionkor98 5 років тому

    I know this is wayyyyyy too late but still
    1. It was trained with GREY data but is now fed BGR?
    2. You messed up the right[:len(forward)] thing in your corrections there, still
    3. You reshaped and resized, dont think that's needed.

    • @mankaransingh2599
      @mankaransingh2599 5 років тому

      1st of all, its not being fed BGR, he converted it to gray scale, secondly, the resizing is necessary because model was trained on that size of image, and reshaping for the same reason.
      and the right[:len(forward)] part wont really make a huge difference.

  • @ciusingwong3258
    @ciusingwong3258 6 років тому

    So weird :
    UnicodeEncodeError: 'utf-8' codec can't encode character '\udcbe' in position 2981: surrogates not allowed

  • @numbertoast764
    @numbertoast764 2 роки тому

    For some reason I am getting "ModuleNotFoundError: No module named 'alexnet'"

  • @robertsmith512
    @robertsmith512 5 років тому +1

    Suspicions confirmed you are a Texan howdy from Georgetown

  • @thre322
    @thre322 6 років тому +1

    after year and half , hoping not too late to pick up

  • @WiggumRalph
    @WiggumRalph 7 років тому

    you can hide map in game settings btw. im probs late mentioning that. 😂

    • @England91
      @England91 7 років тому

      Ralph Wiggum I think if you turn off HUD it goes away

    • @WiggumRalph
      @WiggumRalph 7 років тому

      Paul Banks plus one

  • @DigitalicaEG
    @DigitalicaEG 7 років тому

    Should've split the control into two, one for cruise control to maintain speed and another for autopilot to maintain heading.

  • @adeeb12321
    @adeeb12321 7 років тому

    can I make it learn from UA-cam Gameplays ?

    • @sentdex
      @sentdex  7 років тому +1

      You'd need some way to map what you see to actions, not sure how you'd do that from youtube game plays.

    • @adeeb12321
      @adeeb12321 7 років тому

      sentdex and it will be harder because I don't know the keys :/

  • @dniam9859
    @dniam9859 6 років тому +3

    I don't think you trained the model correctly here...
    While recording the training data you should've driven slightly off road every now and then and then center the scooter back in the lane so that the CNN will learn that when it seems like we are going off road, we have to press A to go back in lane and stuff like that.

  • @BebxOfficial
    @BebxOfficial 7 років тому

    You CAN turn off the map! Look at display in settings!
    Ooooor maybe that's only radar.

    • @sentdex
      @sentdex  7 років тому

      the radar is the map, I've tried it on or off, doesnt appear to impact things too much, unless I make training data that would require the map to be understood to be mapped.

  • @Sauerbier_
    @Sauerbier_ 7 років тому

    nice Video! how about let it fly a jet ? ;D

    • @sentdex
      @sentdex  7 років тому +7

      I've actually considered this...especially a jet....with stars...with taking out enemies. Not sure I want to take such a sinister approach though.

    • @Sauerbier_
      @Sauerbier_ 7 років тому

      sentdex would bei realy funny :)

  • @laya8880
    @laya8880 7 років тому +1

    I don't understand this but it's still really interesting.

  • @flynn3203
    @flynn3203 5 років тому

    Ok, for me this tutorial has been fantastic, and I really appreciate all of the work you (Sentdex) have put in. But at this point, I'm now starting to get loads of errors when testing, something to do with access denied.
    I've basically wiped all of my progress and in the end copied everything over from GitHub, since doing that, there are three problems: I don't understand it, it doesn't work, I'm now depressed because of it :(.
    I would have loved to have got this to work on my pc!! - Maybe a revisit is due?

  • @biohoo22
    @biohoo22 6 років тому

    Ugh...I wish he would explain more while he livecodes. It can be difficult to follow the functions without a 10,000 foot overview...

  • @batuhaneroglu6805
    @batuhaneroglu6805 6 років тому

    Your control scheme is unstable. Might to try smoothing the controls so it is not bang-bang

  • @wafflesop6546
    @wafflesop6546 7 років тому +1

    1st also nice job Sentdex!!