AutoRCCar icon indicating copy to clipboard operation
AutoRCCar copied to clipboard

PLEASE HELP - TRAINING ISSUE

Open jhadkaterji opened this issue 5 years ago • 43 comments

I am trying to follow this for a project and am having a serious issue.

I run the training model process and guide through the track several times. Then, when it comes time to have the car drive itself, it only wants to go right. It will just go right forever.

I saw somebody else have this problem but no solution presented. Please help!!

jhadkaterji avatar Apr 01 '19 19:04 jhadkaterji

have you trained the car only for right?

Devanshice020 avatar Apr 01 '19 19:04 Devanshice020

@Devanshice020

No I have not. I have ran the training with a track the looks like this:(attached images).

IMG_5788 IMG_5787

The way I trained it is by running the data collection, and driving my car through it with the keyboard - (mostly driving it forward for a while until i hit the turn where i start to drive it right). Then i take that saved npz file and run the model and it creates it giving me an accuracy percentage.

Whenever I do this and have the car try to run on its own, it just goes right forever. No matter what the camera sees.

I even tried using data from a very recent thread: ( https://drive.google.com/file/d/1kcK2YEr8PdTN50MhcPSfWqxI0GHSEC-a/view )

And still the car was not doing the right thing. I have no idea what the issue could be. Please help!

jhadkaterji avatar Apr 01 '19 19:04 jhadkaterji

how many frames have you collected?

Devanshice020 avatar Apr 01 '19 19:04 Devanshice020

@Devanshice020 I collected around 300 frames and also tried with somebody else's data (354 frames) and the car still would only go right, in a donut.

jhadkaterji avatar Apr 01 '19 19:04 jhadkaterji

first only collect and train for forward if it works then start training for right, left.

Devanshice020 avatar Apr 01 '19 19:04 Devanshice020

@Devanshice020 I have done this. When I trained the car to only go forward, it would go forward. Then, as I changed the track, I noticed that as soon as there was a single frame that involved right, it would go only right

jhadkaterji avatar Apr 01 '19 19:04 jhadkaterji

try for atleast 1000 frames for each collection for different paths than it will work properly.

Devanshice020 avatar Apr 01 '19 19:04 Devanshice020

@jhadkaterji i have the same problem !!!! how much is your training accuracy ? @Devanshice020 could you explain how ? and what is the problem exactly ??

Siraj95Abudaber avatar Apr 02 '19 15:04 Siraj95Abudaber

I encountered the same problem as you. And I take the time to fix the problem for almost a month And finally it can’t be. I am frustrated.

PuriHa avatar Apr 02 '19 19:04 PuriHa

@Devanshice020 @PuriHa @Sirajabudabe It is so frustrating! I just want to know what I am doing wrong! I have come so far. Somebody, anybody please help us!

jhadkaterji avatar Apr 02 '19 19:04 jhadkaterji

@hamuchiwa any ideas what is the problem ??

Siraj95Abudaber avatar Apr 03 '19 07:04 Siraj95Abudaber

@PuriHa how did you solve it ??

Siraj95Abudaber avatar Apr 03 '19 08:04 Siraj95Abudaber

I don’t know. My problem is The rc car doesn’t follow the track. unstable, Which I don’t understand why. Please help me @hamuchiwa It’s my a Bachelor's degree project. And I only have 2 weeks left.

PuriHa avatar Apr 03 '19 08:04 PuriHa

@PuriHa What is your training and validation accuracy?

Devanshice020 avatar Apr 03 '19 09:04 Devanshice020

@Sirajabudabe @PuriHa If the opencv model doesn't work for you, try to create a CNN in Tensorflow/Keras. I have included an example in #173 in case you haven't tried yet.

hamuchiwa avatar Apr 03 '19 15:04 hamuchiwa

@hamuchiwa I have went to your post and can not see that that CNN in tensor flow. Are you sure you linked the correct post?

jhadkaterji avatar Apr 03 '19 18:04 jhadkaterji

@jhadkaterji https://github.com/hamuchiwa/AutoRCCar/issues/173#issuecomment-478619182

hamuchiwa avatar Apr 03 '19 20:04 hamuchiwa

Make the track as narrow as possible and make your corners more extreme (at an angle more than 75 degrees)

MyFirstRoboticProject avatar Apr 04 '19 15:04 MyFirstRoboticProject

Have you trained the car successfully @MyFirstRoboticProject

Devanshice020 avatar Apr 05 '19 04:04 Devanshice020

No I have not. I have even trained over 1000 frames. I’m not sure what I could be doing wrong. I must be training incorrectly. It just goes forward and doesn't turn now.

On Apr 5, 2019, at 12:25 AM, Devanshice020 [email protected] wrote:

Have you trained the car successfully @MyFirstRoboticProject https://github.com/MyFirstRoboticProject — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hamuchiwa/AutoRCCar/issues/187#issuecomment-480143895, or mute the thread https://github.com/notifications/unsubscribe-auth/Atly7dYlGZGqoYZ8RfqjjO69hTlN04NAks5vdtAggaJpZM4cWbjq.

jhadkaterji avatar Apr 05 '19 04:04 jhadkaterji

I trained my car to 93% validation accuracy. But due to 3 sec lag in video it doesn't turn right or left when it needs to. When I disable the controller and move it manually towards the corner and stop there it then changes from forward to right, so my training is correct. The issue is the camera delay. If that is fixed my project is complete.

MyFirstRoboticProject avatar Apr 05 '19 06:04 MyFirstRoboticProject

And yeah you don't need 1000 samples or otherwise the system will get overtrained. About 200 samples was enough for me, but those samples must be carefully taken and balanced (about equal number of forward, right and left direction frames).

MyFirstRoboticProject avatar Apr 05 '19 06:04 MyFirstRoboticProject

have you changed anything in this code? @MyFirstRoboticProject

Devanshice020 avatar Apr 05 '19 06:04 Devanshice020

Nothing really

MyFirstRoboticProject avatar Apr 05 '19 06:04 MyFirstRoboticProject

have you followed any edge detection algorithm? @MyFirstRoboticProject

Devanshice020 avatar Apr 05 '19 06:04 Devanshice020

Ohk, thank you @MyFirstRoboticProject

Devanshice020 avatar Apr 05 '19 07:04 Devanshice020

How did you captured the image? can you please provide any picture of your track for left turn, right turn. i think the problem is with the camera angle but i am pretty sure that i had tilted the camera to make easy for the camera to view just the tracks but still i ask you how did you kept the camera and pls provide some sample data of yours i mean the images that are captured. @MyFirstRoboticProject

thanks in advance.

Devanshice020 avatar Apr 05 '19 07:04 Devanshice020

Don't tilt the camera to just view the tracks! I think you should read zheng wang's blog again. The upper half of the image frame is not considered in training only the lower half, so you can keep your camera almost vertical

MyFirstRoboticProject avatar Apr 05 '19 08:04 MyFirstRoboticProject

@MyFirstRoboticProject could you please upload your training_data file , I tried everything and the accuracy wont go above 70% !!

Siraj95Abudaber avatar Apr 06 '19 16:04 Siraj95Abudaber

@jhadkaterji Did you find solution to this problem ??

Siraj95Abudaber avatar Apr 10 '19 15:04 Siraj95Abudaber