|
128 | 128 | },
|
129 | 129 | "source": [
|
130 | 130 | "# Get all the files \n",
|
131 |
| - "Since this tutorial will be using a dataset from Kaggle, it requires [creating an API Token](https://github.com/Kaggle/kaggle-api#api-credentials) for your Kaggle acccount, and uploading it. " |
| 131 | + "Since this tutorial will be using a dataset from Kaggle, it requires [creating an API Token](https://github.com/Kaggle/kaggle-api#api-credentials) for your Kaggle account, and uploading it. " |
132 | 132 | ]
|
133 | 133 | },
|
134 | 134 | {
|
|
227 | 227 | },
|
228 | 228 | "outputs": [],
|
229 | 229 | "source": [
|
230 |
| - "# Download data from Kaggle and create a DataFrame.\n", |
| 230 | + "# Download data from Kaggle and unzip the files of interest. \n", |
231 | 231 | "def load_data_from_zip(competition, file):\n",
|
232 | 232 | " with zipfile.ZipFile(os.path.join(competition, file), \"r\") as zip_ref:\n",
|
233 | 233 | " unzipped_file = zip_ref.namelist()[0]\n",
|
|
1177 | 1177 | "1. Since our model architecture is already in memory, we can simply call `load_weights(save_model_path)`\n",
|
1178 | 1178 | "2. If you wanted to load the model from scratch (in a different setting without already having the model architecture in memory) we simply call \n",
|
1179 | 1179 | "\n",
|
1180 |
| - "```model = models.load_model(save_model_path, custom_objects={'bce_dice_loss': bce_dice_loss, 'mean_iou': mean_iou,'dice_coeff': dice_coeff})```, specificing the necessary custom objects, loss and metrics, that we used to train our model. \n", |
| 1180 | + "```model = models.load_model(save_model_path, custom_objects={'bce_dice_loss': bce_dice_loss, 'dice_loss': dice_loss})```, specificing the necessary custom objects, loss and metrics, that we used to train our model. \n", |
1181 | 1181 | "\n",
|
1182 | 1182 | "If you want to see more examples, check our the [keras guide](https://keras.io/getting-started/faq/#how-can-i-save-a-keras-model)!"
|
1183 | 1183 | ]
|
|
1194 | 1194 | "source": [
|
1195 | 1195 | "# Alternatively, load the weights directly: model.load_weights(save_model_path)\n",
|
1196 | 1196 | "model = models.load_model(save_model_path, custom_objects={'bce_dice_loss': bce_dice_loss,\n",
|
1197 |
| - " 'dice_coeff': dice_coeff})" |
| 1197 | + " 'dice_loss': dice_loss})" |
1198 | 1198 | ]
|
1199 | 1199 | },
|
1200 | 1200 | {
|
|
0 commit comments