| 363 | |
| 364 | |
| 365 | def ensure_baseline_weights(net_path): |
| 366 | if net_path is not None: |
| 367 | raise ValueError('Net path should not be set when running the baseline agent as it has its own weights.') |
| 368 | net_path = os.path.join(c.BASELINE_WEIGHTS_DIR, c.BASELINE_WEIGHTS_VERSION) |
| 369 | if not glob.glob(net_path + '*'): |
| 370 | print('\n--------- Baseline weights not found, downloading ----------') |
| 371 | download(c.BASELINE_WEIGHTS_URL + '?cache_bust=' + c.BASELINE_WEIGHTS_VERSION, c.WEIGHTS_DIR, |
| 372 | warn_existing=False, overwrite=True) |
| 373 | return net_path |