M2M Day 196: Debugging, and self-driving cars in real life

This post is part of Month to Master, a 12-month accelerated learning project. For May, my goal is to build the software part of a self-driving car.

Yesterday, I finished formatting the new dataset, so, when I got home today from work, I was all ready to start training the model.

Yet, when I executed the train command in Terminal, my computer stalled for a second and then spit out an error. Specifically, a “list index out of range” error.

Typically, you get this kind of error when the program is expecting a list of things that is longer than the actual list of things.

Since the NVIDIA dataset is longer/larger than the Udacity dataset, I figured that the value for list length must be hardcoded, and I could adjust this value accordingly.

However, after looking through the code, I couldn’t find the problem. Everything seemed like it should work.

So, I added in a few print statements to the code, which would help me see what’s going on under the hood and exactly where the program is breaking.

I ran the program with the print statements, and got this output:

The program successfully iterated through all the lines of actual data, and then seemed to attempt to parse an extra line of data that doesn’t exist.

So, I opened the data.txt file, and sure enough… I had accidentally copied a few empty lines at the end of file.

I deleted these three empty lines, and reran the program in Terminal.

It worked, and the model started training.


While the model trains (we’ll check in on it tomorrow), I thought I’d share a quick, fun aside:

Today, on my commute into work, I passed a Google/Waymo self-driving car near the Mountain View train station.

Then, on my commute home, a few blocks away from my apartment, I saw two self-driving Ubers in row.

Here’s a slightly clearer picture of the lead Uber: It looks like it is currently being human-driven, likely for training purposes. The Google car was driving itself.

Almost every day during my commute, I see a few self-driving cars, but only thought today about taking and sharing a few photos. The fact that I’m already numb to the site of a self-driving car is pretty crazy — they are clearly not so far away from being a ubiquitous reality (regulation aside).

Anyway, it’s pretty cool to think that the software I’m running on my personal computer is essentially powerful enough to control these actual cars.

Read the next post. Read the previous post.

Max Deutsch is a product manager at Intuit, the creator of Somebody.io and Rightspeed, and the guinea pig for Month to Master.

If you want to follow along with Max’s year-long accelerated learning project, make sure to follow this Medium account.