Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidated a few checks #774

Merged
merged 1 commit into from
Jan 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions GANDLF/utils/parameter_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ def populate_header_in_parameters(parameters, headers):
parameters["model"]["num_classes"] = len(headers["predictionHeaders"])

# initialize model type for processing: if not defined, default to torch
if not ("type" in parameters["model"]):
parameters["model"]["type"] = "torch"
parameters["model"]["type"] = parameters["model"].get("type", "torch")

if parameters["model"]["type"] == "openvino" and parameters["model"][
"architecture"
] in ["brain_age", "sdnet"]:
print(
"Only PyTorch for inference is supported for the current model architecture: {0}.".format(
"Only PyTorch for inference is supported for the current network topology: {0}.".format(
parameters["model"]["architecture"]
)
)
parameters["model"]["type"] = "torch"

# initialize number of channels for processing
if not ("num_channels" in parameters["model"]):
parameters["model"]["num_channels"] = len(headers["channelHeaders"])
parameters["model"]["num_channels"] = parameters["model"].get(
"num_channels", len(headers["channelHeaders"])
)

parameters["problem_type"] = find_problem_type(
parameters, get_modelbase_final_layer(parameters["model"]["final_layer"])
Expand Down
Loading