autorope / donkeycar

Open source hardware and software platform to build a small scale self driving car.
http://www.donkeycar.com
MIT License
3.15k stars 1.3k forks source link

train model problem #327

Closed easonzrq closed 5 years ago

easonzrq commented 6 years ago

When I run python manage.py drive --model ./models/mypilot,and then choose LocalAngle,this mistake was occured:

Traceback (most recent call last): File "manage.py", line 190, in drive(cfg, model_path = args['--model'], use_joystick=args['--js'], use_chaos=args['--chaos']) File "manage.py", line 131, in drive max_loop_count=cfg.MAX_LOOPS) File "/home/pi/env/lib/python3.5/site-packages/donkeycar/vehicle.py", line 93, in start self.update_parts() File "/home/pi/env/lib/python3.5/site-packages/donkeycar/vehicle.py", line 129, in update_parts outputs = p.run(*inputs) File "/home/pi/env/lib/python3.5/site-packages/donkeycar/parts/keras.py", line 75, in run angle_unbinned = util.data.linear_unbin(angle_binned[0]) File "/home/pi/env/lib/python3.5/site-packages/donkeycar/util/data.py", line 38, in linear_unbin raise ValueError('Illegal array length, must be 15') ValueError: Illegal array length, must be 15

Every time I can only run python manage.py drive and then choose LocalAngle,but it does not achieve the desired result.

Turbosi03 commented 6 years ago

I'm using Donkey car v2.5.1 pi image on a pi3 B+ and had the same issue. For me, I tried to collect any data from parking lot driving instead of track. Then made a model based on the poor training data. I confirmed the manage.py drive works with the newly made model, but soon as I switch to other modes which rely on the model (such as local angle) it crashes program with exact messages posted above.

Then I commented out lines 38, 39 in data.py to confirm the script can continue to run and the result was the user drive mode is normal, but when changing to local angle mode, the wheels turn all the way to left, and no more script crash with the above message. Unfortunately, it can only drive in a circle.

For reference, data.py is found in this folder path: home/pi/env/lib/python3.5/site-packages/donkeycar/util

Finally, to confirm if the program has an issue or if this is caused by training data, I downloaded an existing model which can be found on the nicely put together sheet here: https://docs.google.com/spreadsheets/d/1YP5Q8evHyQdpLUk-q67TWSM0zQGCRA2Y4A1iQh4-bAQ/edit?pli=1#gid=0

I used line 10 which is provided by Alan Wells "alanwells_jun17.hdf5" and also returned line 38, 39 to data.py. Turns out to work just fine! No more illegal array length for linear_unbin. I can use local angle drive mode now, although it makes poor steering decisions in an open parking lot and none of my own training data.

So I think you and I both need to simply collect good usable training data and we should be off to the races. Please try to use one of the shared models posted online to check for yourself.

Good luck! Dustin