Skip to content

Commit

Permalink
Add custom model names to VGSLSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
TimKoornstra committed Sep 25, 2023
1 parent 46dd41c commit 290686a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ def main():
print("creating new model")
model_generator = VGSLModelGenerator(
model=args.model,
name=args.model_name,
channels=model_channels,
output_classes=len(char_list) + 2
if args.use_mask else len(char_list) + 1
Expand Down
7 changes: 3 additions & 4 deletions src/vgsl_model_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ def __init__(self,
self._initializer = initializers.GlorotNormal(seed=42)
self._channel_axis = -1
self.model_library = VGSLModelGenerator.get_model_libary()
self.model_name = name if name else model

if model is None:
raise ValueError("No model provided. Please provide a model name "
Expand All @@ -115,6 +114,8 @@ def __init__(self,
self.init_model_from_string(model_string,
channels,
output_classes)
self.model_name = name if name else model

except KeyError:
raise KeyError("Model not found in model library")
else:
Expand All @@ -123,9 +124,7 @@ def __init__(self,
self.init_model_from_string(model,
channels,
output_classes)

# TODO: Add model_name argument to arg_parser.py
self.model_name = "custom_model"
self.model_name = name if name else "custom_model"

except (TypeError, AttributeError) as e:
raise ("Something is wrong with the input string, "
Expand Down

0 comments on commit 290686a

Please sign in to comment.