"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. "
"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. "
]
]
},
},
{
{
...
@@ -227,7 +227,7 @@
...
@@ -227,7 +227,7 @@
},
},
"outputs": [],
"outputs": [],
"source": [
"source": [
"# Download data from Kaggle and create a DataFrame.\n",
"# Download data from Kaggle and unzip the files of interest. \n",
"def load_data_from_zip(competition, file):\n",
"def load_data_from_zip(competition, file):\n",
" with zipfile.ZipFile(os.path.join(competition, file), \"r\") as zip_ref:\n",
" with zipfile.ZipFile(os.path.join(competition, file), \"r\") as zip_ref:\n",
" unzipped_file = zip_ref.namelist()[0]\n",
" unzipped_file = zip_ref.namelist()[0]\n",
...
@@ -1177,7 +1177,7 @@
...
@@ -1177,7 +1177,7 @@
"1. Since our model architecture is already in memory, we can simply call `load_weights(save_model_path)`\n",
"1. Since our model architecture is already in memory, we can simply call `load_weights(save_model_path)`\n",
"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",
"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",
"\n",
"\n",
"```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",
"```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",
"\n",
"\n",
"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)!"
"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)!"
]
]
...
@@ -1194,7 +1194,7 @@
...
@@ -1194,7 +1194,7 @@
"source": [
"source": [
"# Alternatively, load the weights directly: model.load_weights(save_model_path)\n",
"# Alternatively, load the weights directly: model.load_weights(save_model_path)\n",