Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ymir committed Feb 13, 2022
1 parent 1076345 commit bfcff82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 4 additions & 2 deletions det-yolov4-training/config_and_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def get_model_seen(model_path):
header = nd.array(np.fromfile(mf, dtype=np.int32, count=5))
seen_images_array = header[3]
return int(seen_images_array.asscalar())


def get_pretrained_best_map():
try:
with open('/out/models/result.yaml', 'r') as f:
Expand Down Expand Up @@ -47,6 +47,8 @@ def get_pretrained_best_map():
max_batches = config["max_batches"]
pretrained_model_params_conf = config.get("pretrained_model_params", None)
batch = int(config["batch"])
if image_width != image_height:
raise ValueError('width and height mismatch')
if batch <= 0:
raise ValueError('invalid batch size')
subdivisions = config["subdivisions"]
Expand Down
3 changes: 0 additions & 3 deletions det-yolov4-training/convert_model_darknet2mxnet_yolov4.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,6 @@ def parse_args():
def run(num_of_classes: int, input_h: int, input_w: int, load_param_name: str, export_dir: str) -> None:
if not os.path.isfile(load_param_name):
return
if input_w != input_h:
logging.error(f"width: {input_w} vs height: {input_h}")
return

net = Darknet(num_of_classes, input_dim=input_h)
net.initialize()
Expand Down

0 comments on commit bfcff82

Please sign in to comment.