Hacker News new | ask | show | jobs
by sentdex 3353 days ago
Wow, hello hacker news! I haven't seen pythonprogramming.net load this slow in a ... ever.

Thanks for sharing my silly project!

Any ideas, pull requests, or critiques are welcome. (https://github.com/sentdex/pygta5/)

I'm currently working on PID control, and also contemplating switching the model to a DQN, with a reward for speed (whether this is perceived, or read from the game directly) IF we're on a paved surface. If you know about either, don't be shy.

If you hate long loading, you can watch just the videos on youtube: https://www.youtube.com/playlist?list=PLQVvvaa0QuDeETZEOy4Vd...

edit: added link to github, as well as links to just the videos since pythonprogramming.net is going slow from traffic.

5 comments

I'm always curious when someone shows up with a super impressive project, but has never registered a user name on Hacker News.

Can I ask "where have you been all this time" - Do you have some other aggregator or blogroll that you follow? Do you try to avoid time wasted surfing different articles and comments? Did you know about HN before and avoid it due to its reputation, etc?

I've just never felt the urge to post on hacker news, but it's in my list of places I check frequently for news, I just lurk though. Maybe it's because I dunno how to hacker news, but I just look at the front page. Usually, by the time I am seeing something on HN, whatever I think or have to offer has already been said, usually more eloquently than I'd come up with.

I have more of a presence on reddit (https://www.reddit.com/user/sentdex/). The bar is lower there. ;)

For news, I have a bookmark dir with a bunch of sources in it, I right click and open all whenever I want to check in and see what the world is up to.

> whatever I think or have to offer has already been said

I've only been on HN for about six months now, but from what I have seen in this short time, I wouldn't let "fear" of saying something or posting something you think has already been done stop you.

Case in point: Your first posting. Look at the attention it has gotten. I enjoyed it, and others have enjoyed it. But guess what?

In my short time here I've seen other similar projects posted - and that's not anything against you or them! Ultimately, it's how we all learn from each other, and you shouldn't let prior work stop you from posting - there may be a nugget of new work or something else interesting about it that makes it worthwhile.

For instance, while your project isn't the first of its kind, I do think it may be one of the first to be done in OpenAI's GTA V universe system; even if not, it's one of the few that have been posted here - so it's relatively "fresh".

Just my observations, of course - and thank you for posting!

Although without super-impressive project, I didn't know Hacker News existed until a year or two ago despite over a decade reading on IT, INFOSEC, etc. I was mostly on blogs/forums where I saw knowledgeable people talking about my interests with low noise. Especially Schneier's blog before Snowden leaks when noise showed up.

I think Hacker News has a marketing problem. Many people here assume all the technical folks know about and read it. Whereas, most I meet have never heard of it. So, I just tell them about it. Now, we don't want to give it a bad rap by being zealots shouting about it in places everywhere. But, if bookmarking excellent discussions, you might just drop a link to them when they solve a problem or provide insight that's on another forum. "Hey, that exact thing was discussed on Hacker News with a lot of interesting ideas. Link below. You should probably check out the homepage as it often has lots of neat tech, businesses, etc sometimes with the inventors of them in the comments."

That's what I've been doing.

Personally, I very much prefer that HN is not publicized.
How about only doing it on forums or threads with potentially-valuable members? That's what I do with Lobste.rs give Im responsible for who I invite.
He's been posting great Python tutorials on YouTube for years under the same channel name as his username - super impressive
On the first page, thanks for documenting what actually happens on a daily basis. Sometimes we don't know how to do things, copy and paste something from Stack Overflow, there's a few typos, a little bit more searching, and we get something working and it's good enough for the next step. Thanks for teaching others it's ok to get stuck and solutions don't come in a flash.

As the saying goes, Make it work, make it right, make it fast.

Hi, I watched some of your videos at https://www.youtube.com/user/sentdex and I found them helpful. Keep up the good work :)
Your videos are great/inspirational. Keep it up!!
I'm currently enrolled in Udacity's Self-Driving Car Engineer Nanodegree; I just skimmed your article, but it seems like you've implemented a form of lane-line tracking to control steering.

In the first term of Udacity's course, we had to implement something similar as part of a project - but it was a later project that was most interesting.

We were given this tool:

https://github.com/udacity/self-driving-car-sim

...though at the time it was closed source and only had a couple of tracks. Anyhow, the idea and goal was to extract frames from the simulator (it provided for this) and using Python, OpenCV, TensorFlow and Keras - develop a neural network to guide the vehicle around the track. For the project, speed was fixed in code, and we only had to worry about the steering (though the output of the simulator also provided for accelerator and braking values as well - so we could use them if we wanted to).

The simulator had three "cameras" - left, right, and center. You could drive it around the course (using a keyboard, mouse, or joystick/pad), and it would dump these frames to a directory, as well as a labeled dataset of the frame filenames and the various datapoints.

So - you had a labeled dataset for training a neural network - input a frame, train it to output the proper values for that frame (steering, brake, throttle). The left and right frames (with other adjustments) could be used to simulate drifting near the left or right side and counter-steer away (to prevent going off the road). Other things we did was to augment the data by adding fake shadows, shifting or skewing the images to simulate turns or whatnot, altering the brightness of the images to simulate glare, etc. So you could get a very large dataset to play with; more than enough to split up into training, test, and validation sets.

For myself (and more than a few of the other students), rather than try to implement a custom network to handle the task, we instead implemented a version of NVidia's End-to-End CNN:

https://images.nvidia.com/content/tegra/automotive/images/20...

Some of the details about the architecture you have to make some educated guesses about, plus we had to scale our images down to reduce the number of input parameters to the network (but if you have the memory, go for it!). I ended up using my GTX 750 ti SC for my TensorFlow CUDA (running everything under Ubuntu 14.04). This has about the equivalent power as NVidias embedded Jetson PX car computer platform (better for running the model on rather than training, but I don't have such a real rig yet).

It worked really well. I'd imagine that if you did the same in GTA V, which has more realism, the resulting model could be used as a foundation (transfer learning) to further train a vehicle for real-world driving. I suspect that Udacity's simulator has three cameras because the self-driving vehicle they developed has the same setup (I'm not sure how it is going to work, but the final term project is supposed to be related to the real vehicle in some manner - they claim our code will be ran on the vehicle, but we'll see how that goes).

So...you might want to give that a shot! As some advice here, I found that for Udacity's simulator, using a steering wheel controller system (with pedals) was more natural and generated better data than using a keyboard/mouse/joystick. Also, while it sounds like implementing this kind of system is simple, in reality you might find yourself being frustrated by certain aspects (make sure your dataset is "balanced" - I found issues in one of my runs where my model was biased to left-hand turns, and couldn't cope with a right-hand turn, for instance) - but these can lead to interesting and humorous results:

I had one model which got confused, and would turn off the road in the simulator and drive on a dirt area; this dirt area was defined, but "edges" consisted of berms and warning signs; other than that it looked the same as the ground. The dirt area wound around then eventually led back out to the track.

My model, driving the car, would invariably go off-roading on this section - but despite never having trained in this area, it drove it relatively perfectly! It would follow the dirt around, and get back on the track, at which point when it got to the dirt entrance again, it would do it over. It did this several times, and was fun to watch. Somehow, the CNN model had enough knowledge from on-road driving to handle a simple case of off-road driving as well...

So you might want to give this option a shot in the future. I personally have waiting in the wings a machine that I planned to build for running GTA V, based around a GTX 970 - it was going to be a gaming machine, but now I am seriously considering making it my next workstation for machine learning (and perhaps upgrading to a 1080).

You can just re-structure your post and make it a blog article :)