updates
This commit is contained in:
parent
256bf72f8e
commit
95bc4736f3
|
@ -674,7 +674,7 @@ def kmeans_targets(path='../coco/trainvalno5k.txt', n=9, img_size=416): # from
|
||||||
def print_mutation(hyp, results, bucket=''):
|
def print_mutation(hyp, results, bucket=''):
|
||||||
# Print mutation results to evolve.txt (for use with train.py --evolve)
|
# Print mutation results to evolve.txt (for use with train.py --evolve)
|
||||||
a = '%10s' * len(hyp) % tuple(hyp.keys()) # hyperparam keys
|
a = '%10s' * len(hyp) % tuple(hyp.keys()) # hyperparam keys
|
||||||
b = '%10.5g' * len(hyp) % tuple(hyp.values()) # hyperparam values
|
b = '%10.3g' * len(hyp) % tuple(hyp.values()) # hyperparam values
|
||||||
c = '%10.3g' * len(results) % results # results (P, R, mAP, F1, test_loss)
|
c = '%10.3g' * len(results) % results # results (P, R, mAP, F1, test_loss)
|
||||||
print('\n%s\n%s\nEvolved fitness: %s\n' % (a, b, c))
|
print('\n%s\n%s\nEvolved fitness: %s\n' % (a, b, c))
|
||||||
|
|
||||||
|
@ -684,7 +684,7 @@ def print_mutation(hyp, results, bucket=''):
|
||||||
with open('evolve.txt', 'a') as f: # append result
|
with open('evolve.txt', 'a') as f: # append result
|
||||||
f.write(c + b + '\n')
|
f.write(c + b + '\n')
|
||||||
x = np.unique(np.loadtxt('evolve.txt', ndmin=2), axis=0) # load unique rows
|
x = np.unique(np.loadtxt('evolve.txt', ndmin=2), axis=0) # load unique rows
|
||||||
np.savetxt('evolve.txt', x[np.argsort(-fitness(x))], '%10.5g') # save sort by fitness
|
np.savetxt('evolve.txt', x[np.argsort(-fitness(x))], '%10.3g') # save sort by fitness
|
||||||
|
|
||||||
if bucket:
|
if bucket:
|
||||||
os.system('gsutil cp evolve.txt gs://%s' % bucket) # upload evolve.txt
|
os.system('gsutil cp evolve.txt gs://%s' % bucket) # upload evolve.txt
|
||||||
|
|
Loading…
Reference in New Issue