deep-anpr icon indicating copy to clipboard operation
deep-anpr copied to clipboard

IndexError: list index out of range in train.py

Open sauman07 opened this issue 7 years ago • 1 comments

I'm getting this error while running train.py file.

File "C:/Users/SaumanBalkhi/Desktop/FYP/Deep ANPR/train.py", line 261, in initial_weights=initial_weights)

File "C:/Users/SaumanBalkhi/Desktop/FYP/Deep ANPR/train.py", line 234, in train do_batch()

File "C:/Users/SaumanBalkhi/Desktop/FYP/Deep ANPR/train.py", line 219, in do_batch do_report()

File "C:/Users/SaumanBalkhi/Desktop/FYP/Deep ANPR/train.py", line 204, in do_report print ("B{:3d} {:2.02f}% {:02.02f}% loss: {} "

AttributeError: 'NoneType' object has no attribute 'format'

sauman07 avatar Dec 02 '17 18:12 sauman07

You need change line 204. like this:

    print("B{:3d} {:2.02f}% {:02.02f}% loss: {} (digits: {}, presence: {}) |{}|".format(batch_idx, 100. * num_correct / (len(r[0])), 100. * num_p_correct / len(r[2]), r[6], r[4], r[5],  "".join("X "[numpy.array_equal(b, c) or (not pb and not pc)] for b, c, pb, pc in zip(*r_short))))

Aquamars avatar Mar 19 '18 01:03 Aquamars