Skip to content

Commit

Permalink
Merge pull request #224 from mlrun/0.10.x-dev
Browse files Browse the repository at this point in the history
0.10.x dev
  • Loading branch information
aviaIguazio authored Feb 10, 2022
2 parents 55d2504 + 81c8542 commit 21c7f36
Show file tree
Hide file tree
Showing 6 changed files with 205 additions and 77 deletions.
9 changes: 1 addition & 8 deletions mask-detection/1-training-and-evaluation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@
"\n",
"With just one line of code, it seamlessly provides **automatic logging** (for both MLRun and Tensorboard) and **distributed training** by wrapping the `fit` and `evaluate` methods of `tf.keras.Model`.\n",
"\n",
"In addition, in the `evaluate` method code, we use the `TFKerasModelHandler` class. This class supports loading, saving and logging `tf.keras` models with ease, enabling easy versioning of the model and his results, artifacts and custom objects."
"In addition, there is the `TFKerasModelHandler` class that is being returned from `apply_mlrun`. This class supports loading, saving and logging `tf.keras` models with ease, enabling easy versioning of the model and his results, artifacts and custom objects. Pay attention that by default, the model is loaded and logged automatically by `apply_mlrun`."
]
},
{
Expand Down Expand Up @@ -1116,13 +1116,6 @@
")"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We will now save our project with the registered functions for using them later in the pipeline:"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
4 changes: 2 additions & 2 deletions mask-detection/3-automatic-pipeline.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
"project.set_function(\"hub://open_archive\", name=\"open_archive\")\n",
"\n",
"# Import the `onnx_utils` function to optimize the model:\n",
"project.set_function(\"hub://onnx_utils:development\", name=\"onnx_utils\")"
"project.set_function(\"hub://onnx_utils\", name=\"onnx_utils\")"
]
},
{
Expand Down Expand Up @@ -719,4 +719,4 @@
},
"nbformat": 4,
"nbformat_minor": 4
}
}
2 changes: 1 addition & 1 deletion mask-detection/pytorch/training-and-evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ def evaluate(
# Initialize the loss:
loss = torch.nn.MSELoss()

# Evaluate:
# Evaluate (the model will be loaded automatically from the provided model path):
mlrun_torch.evaluate(
model_path=model_path,
dataset=evaluation_set,
Expand Down
12 changes: 2 additions & 10 deletions mask-detection/tf-keras/training-and-evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,8 @@ def evaluate(
dataset_path=dataset_path, batch_size=batch_size, is_evaluation=True
)

# Load the model using MLRun's model handler:
model_handler = mlrun_tf_keras.TFKerasModelHandler(
model_name="mask_detector", model_path=model_path, context=context
)
model_handler.load()

# Apply MLRun's interface for tf.keras:
mlrun_tf_keras.apply_mlrun(
model=model_handler.model,
model_name="mask_detector",
# Apply MLRun's interface for tf.keras and load the model:
model_handler = mlrun_tf_keras.apply_mlrun(
model_path=model_path,
context=context,
)
Expand Down
Loading

0 comments on commit 21c7f36

Please sign in to comment.