Skip to content

Commit

Permalink
Merge pull request #33 from MortenTabaka/fix/Correctly-get-project-re…
Browse files Browse the repository at this point in the history
…pository-root-and-exclude-training-notebooks

Fix/correctly get project repository root and exclude training notebooks
  • Loading branch information
MortenTabaka committed Aug 6, 2023
2 parents c6a3c4b + 7d58c3e commit 9fd86ac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,4 @@ models/saved_weights
/notebooks/templates/results/
/notebooks/templates/best_miou_score_weights/
/notebooks/exploratory/
/notebooks_training/
24 changes: 13 additions & 11 deletions notebooks/model_training_template.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,10 @@
"import sys\n",
"from typing import List\n",
"\n",
"\n",
"import tensorflow as tf\n",
"from tensorflow.compat.v1 import ConfigProto\n",
"from tensorflow.compat.v1 import InteractiveSession\n",
"\n",
"\n",
"ABS_PATH = %pwd\n",
"notebook_path = [idx for idx,ch in enumerate(ABS_PATH) if ch=='/']\n",
"notebooks_level_in_the_project = 1\n",
"\n",
"PROJECT_PATH = ABS_PATH[:notebook_path[-notebooks_level_in_the_project]]\n",
"if PROJECT_PATH not in sys.path:\n",
" sys.path.append(PROJECT_PATH)\n",
"\n",
"\n",
"config = ConfigProto()\n",
"config.gpu_options.allow_growth = True\n",
"session = InteractiveSession(config=config)"
Expand Down Expand Up @@ -81,6 +70,19 @@
"NUM_CLASSES = 5"
]
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"PROJECT_PATH = UrlDownloader().get_project_root()\n",
"if PROJECT_PATH not in sys.path:\n",
" sys.path.append(PROJECT_PATH)"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "markdown",
"id": "93eccb38",
Expand Down

0 comments on commit 9fd86ac

Please sign in to comment.