Skip to content

Commit

Permalink
fixed params file selection from the main_config (#171)
Browse files Browse the repository at this point in the history
the neural_net_api only selects the first file from the param directory in the main config, now it searches explicitly for a .params file

Co-authored-by: Jannik Holmer <HolmerJannik@gmail.com>
  • Loading branch information
bingobongomann and bingobongomann authored Mar 25, 2022
1 parent bc1c882 commit 2696cc3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion DeepCrazyhouse/src/domain/agent/neural_net_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ def __init__(self, ctx="cpu", batch_size=1, select_policy_form_planes: bool = Tr
self.symbol_path = glob.glob(model_architecture_dir + "*")[0]

if model_weights_dir == "default":
self.params_path = glob.glob(main_config["model_weights_dir"] + "*")[0]
self.params_path = None

paths = glob.glob(main_config["model_weights_dir"] + "*")
for path in paths:
if ".params" in path:
self.params_path = path
else:
self.params_path = glob.glob(model_weights_dir + "*")[0]
# make sure the needed files have been found
Expand Down

0 comments on commit 2696cc3

Please sign in to comment.