BrunoTh / ETS2Autopilot

Autopilot for Euro Truck Simulator 2 using TensorFlow (OBSOLETE)
https://www.ets2autopilot.com/
MIT License
89 stars 15 forks source link

Training Data is not actually recording anything #2

Closed Caleb-J773 closed 7 years ago

Caleb-J773 commented 7 years ago

The data files aka the captured folders have 0 bytes of any info and attempting to train them results in this error Traceback (most recent call last): File "train.py", line 31, in import driving_data File "C:\Users\User1\Downloads\ETS2Autopilot-master\ETS2Autopilot-master\driving_data.py", line 99, in xs, ys = zip(*c) ValueError: not enough values to unpack (expected 2, got 0)

Caleb-J773 commented 7 years ago

Also the console is showing my joystick presses so it should be recording something.

BrunoTh commented 7 years ago

To record data you have to run start_recording.bat or the python-script collect_data.py. This script saves the images to captured.

After you have collected many data you execute start_training.bat. This script creates your autopilot model. And then you can run start_autopilot.bat to let the computer steer for you.

BrunoTh commented 7 years ago

And have you activated the recording by pressing the autopilot button you set in the settings.py?

Caleb-J773 commented 7 years ago

I did, and it trained but now when i got to turn it on, the camera just shoots up out of the truck into the sky like looks at the sky, it doesn't turn or gas the truck at all. Even after turning it off it continues to have the camera forced up in the sky.

BrunoTh commented 7 years ago

All right. It seems like your controller configuration isn't correct. Please open the settings in ETS2 and go to the controller settings. There you have to choose Keyboard + vJoy Device. Then set the steering axis by moving your joystick or steering wheel. You need to have start_autopilot.bat running. After that just add your normal controller from the list on top and set your keys etc. like before.

Caleb-J773 commented 7 years ago

20170719113342_1 20170719113347_1

Now it's not doing anything no input nothing.

Caleb-J773 commented 7 years ago

Here's a controller layout ^^

BrunoTh commented 7 years ago

Nice. Thank you for the image :D For the first row you have to choose "Keyboard + vJoy Device". The second should be "Controller (XBOX 360 For Windows)" and the last "XInput Gamepad 1".

So far so good. That is the order. To let the computer steer for you you have to set the right steering axis. For that set row 2 and 3 to "undefined", click on the Steering axis field and move your joystick or steering wheel. The value of the field should change. After that, set row 2 and 3 to what I've written before.

Caleb-J773 commented 7 years ago

20170719120714_1

Still doing the same thing even after doing what you said. I have the correct right steering axis and it keeps doing the look axis.

BrunoTh commented 7 years ago

Then scroll a bit down on the settings page. There is an other axis. View axis or something like that. You have to unassign that axis.

Caleb-J773 commented 7 years ago

idk why this isn't working at all I either get no input, or if i do it's just pointing the camera up. I unassigned that axis and well i get the no input

Caleb-J773 commented 7 years ago

My controller layout Keyboard + vJoy Device Controller (XBOX 360 For Windows) XInput Gamepad 1

Is it possible vjoy isn't working or did the ai bot get confused on the controls?

BrunoTh commented 7 years ago

Okay. For the record:

Caleb-J773 commented 7 years ago

20170719131154_1

^^ It's working but it's doing that right now.. I guess it needs more training data?

BrunoTh commented 7 years ago

Jep. That's right. If you want you can try out my trained model. https://www.ets2autopilot.com/model.zip Just download and extract the content into the save folder.

Maybe you have to set the controller subtype to gamepad because I used one.

But I really recommend to collect your own data with the steering wheel. ;)

Caleb-J773 commented 7 years ago

ashampoo_snap_2017 07 19_15h16m24s_010_

Now, it's doing this again. It's like it's locked on steering

Caleb-J773 commented 7 years ago

Something's off with vjoy or something

BrunoTh commented 7 years ago

That's strange. If you could open the windows menu and open the program "vJoy analyzer" or something like that? This program shows the states of the axes and buttons of the vJoy Device. When it's running please activate the autopilot and look if the bar of the y-axis is moving. If the bar goes up, the autopilot is steering to the right. Down means left. Is this bar equivalent to the steering wheel image?

Caleb-J773 commented 7 years ago

ashampoo_snap_2017 07 19_16h29m58s_011_ None of them are moving. Something with vjoy or the script?

BrunoTh commented 7 years ago

The autopilot isn't activated. It shows False. You have to push the autopilot button (the same button for recording).

Caleb-J773 commented 7 years ago

Turned it on, shows up on bar, tries the game, no input it's not steering.

Caleb-J773 commented 7 years ago

The game isn't receiving any input from vjoy however other controllers, keyboard works fine. I have the same setup keyboard + vjoy thing going on here.

BrunoTh commented 7 years ago

Okay. Then assign the steering axis in the game settings again please. Set the other devices top undefined and then move the steering wheel while start_autopilot.bat is running and the autopilot is deactivated (you see False in the console).

Caleb-J773 commented 7 years ago

Yea again still no input from vjoy in the game autopilot on.

BrunoTh commented 7 years ago

But the steering axis is set to "Joy Y Axis"? And when you assign this axis, can you see the yellow bar in the field indicating the joystick position? When you are in-game can you steer manually? The vjoy device seems to work normally.

Caleb-J773 commented 7 years ago

Yes, I can steer with the second controller on the JOY y Axis, Vjoy isn't sending any input to the game at all

Caleb-J773 commented 7 years ago

I don't think this is working at all. My controllers everything works fine, Joy Y axis etc.

Caleb-J773 commented 7 years ago

You know what, I think it was saying something like JOY 2 as in 2nd controller, How do i change it for the 1st controller aka keyboard + vjoy?

BrunoTh commented 7 years ago

You have to set the other controllers to undefined or none. The list should look like: keyboard + vjoy undefined undefined

Then you have to assign the steering axis. Click into the field and move your steering wheel while start_autopilot.bat is running and showing False. The autopilot has to be disabled (IMPORTANT!). After that the steering axis should be assigned to the vjoy controller.

At the end you set your 2nd and 3rd controller.

Caleb-J773 commented 7 years ago

I don't have a steering wheel, I just have a gamepad. aka xbox controller, besides you can't set anything cause vjoy isn't attached to my xbox controller or so.

BrunoTh commented 7 years ago

Okay. I thought you had one but the gamepad does work too. Have you set JOYSTICK in settings.py? You can find out the id with the gamepad_analyzer.py.

Caleb-J773 commented 7 years ago

Correct

BrunoTh commented 7 years ago

And when start_autopilot.bat is running, can you see changing values when you move the steering joystick?

Caleb-J773 commented 7 years ago

Yes.

BrunoTh commented 7 years ago

Then the settings for the autopilot are correct and the problem are the ETS2 settings. Can you send me a screenshot with the controller list and the steering axis config please?

Caleb-J773 commented 7 years ago

20170720080551_1 20170720080557_1 This should work right? Should i test?

BrunoTh commented 7 years ago

Thank you. Yeah. This should work.

Caleb-J773 commented 7 years ago

Huh it looks like it was working, then the game crashes. What gives?

BrunoTh commented 7 years ago

Wow! It's getting stranger xD Just restart the game and try again.

Caleb-J773 commented 7 years ago

Ah nevermind it was because i alt tabbed but it's working it's finnaly steering, Had to correct it's steering a bit but im sure it learns from it's mistakes? Or just some more training will do 👍

Love to show off some more demo videos.

Thank you for the all the help 👍 I'll come to you if I need anymore help

Caleb-J773 commented 7 years ago

Also, When does the windows version detect cars? Cause it's only on linux, would love to have it on windows

BrunoTh commented 7 years ago

No problem. Good to hear that it's finally working. Currently the self steering part and the recording part are separated. That means any corrections you do have no influence on the autopilot training. I think I will add this soon after the GUI is working (which could be soon).

This version is only for keeping lanes. So cars wont get detected. But I also want to include that feature in future.

Have fun! And collect as much data as you can. The model I sent you was trained with 50,000 pictures (or even more? I don't know ^^)

Caleb-J773 commented 7 years ago

Can i add on or does it start a new save file with my pictures?

Caleb-J773 commented 7 years ago

Also it's doing a dang better job on this turn then me LOL

BrunoTh commented 7 years ago

It's starting a new save file. I have to do some testing to find out if it is posible to add more data to an existing model.

Haha. Nice :D