multunus / autonomous-rc-car

Autonomous RC car using Raspberry Pi and ANN
MIT License
306 stars 102 forks source link

train.py compilation error #5

Closed geek1111 closed 7 years ago

geek1111 commented 7 years ago

Im having an issue when execute the command of "train.py".I have done every procedure accordingly . The error is given below . Please Help ASAP python version used : python 2.7

pi@AutoCar:~/autonomous-rc-car-master $ python train.py 0.1 60 Loading images to array... Traceback (most recent call last): File "train.py", line 114, in <module> main() File "train.py", line 107, in main (optimized_theta, function_min_value, info_dict) = minimize_cost_function(initial_theta,function_parameters) File "train.py", line 72, in minimize_cost_function fprime=gradients_wrapper, args=[function_parameters]) File "/usr/lib/python2.7/dist-packages/scipy/optimize/lbfgsb.py", line 186, in fmin_l_bfgs_b **opts) File "/usr/lib/python2.7/dist-packages/scipy/optimize/lbfgsb.py", line 314, in _minimize_lbfgsb f, g = func_and_grad(x) File "/usr/lib/python2.7/dist-packages/scipy/optimize/lbfgsb.py", line 265, in func_and_grad f = fun(x, *args) File "/usr/lib/python2.7/dist-packages/scipy/optimize/optimize.py", line 281, in function_wrapper return function(*(wrapper_args + args)) File "train.py", line 32, in cost_function_wrapper return cost_function(cost_function_parameters) File "/home/pi/autonomous-rc-car-master/cost_function.py", line 35, in cost_function regularization_term = (lambda_value/(2.0 * input_examples_size)) * numpy.sum(numpy.power(combined_thetas, 2)) ZeroDivisionError: float division by zero

Vignesh1115 commented 7 years ago

Hi @geek1111, The value of input_examples_size is zero and this caused the ZeroDivisionError. This is because there are no images in the folders for the five class labels i.e. forward, reverse, left, right and idle. Can you segregate the images into their respective folders and run the command?

Vignesh1115 commented 7 years ago

Hi @geek1111, I hope the issue was resolved. Let me know if you need help with anything. I will be closing this issue.