Unverified Commit bf294271 authored by Michael Gruben-Trejo's avatar Michael Gruben-Trejo Committed by GitHub
Browse files

Fix PythonPath dependencies

Previously, code block one attempted to import `from object_detection.utils` before the `object_detection` directory was added to the PythonPath via `sys.path.append("..")`.

This generated a `ModuleNotFoundError`.

Accordingly, append `".."` to the PythonPath before attempting to import from `object_detection` as a module, instead of after.
parent f51da4bb
...@@ -35,6 +35,9 @@ ...@@ -35,6 +35,9 @@
"from io import StringIO\n", "from io import StringIO\n",
"from matplotlib import pyplot as plt\n", "from matplotlib import pyplot as plt\n",
"from PIL import Image\n", "from PIL import Image\n",
"\n",
"# This is needed since the notebook is stored in the object_detection folder.\n",
"sys.path.append(\"..\")\n",
"from object_detection.utils import ops as utils_ops\n", "from object_detection.utils import ops as utils_ops\n",
"\n", "\n",
"if tf.__version__ < '1.4.0':\n", "if tf.__version__ < '1.4.0':\n",
...@@ -55,10 +58,7 @@ ...@@ -55,10 +58,7 @@
"outputs": [], "outputs": [],
"source": [ "source": [
"# This is needed to display the images.\n", "# This is needed to display the images.\n",
"%matplotlib inline\n", "%matplotlib inline"
"\n",
"# This is needed since the notebook is stored in the object_detection folder.\n",
"sys.path.append(\"..\")"
] ]
}, },
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment