Skip to content

Commit 83d7117

Browse files
committed
removed temporary export fix
1 parent a9bb781 commit 83d7117

File tree

2 files changed

+0
-46
lines changed

2 files changed

+0
-46
lines changed

Diff for: README.md

-2
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,6 @@ The training script saves checkpoints about every five minutes. Train the model
256256

257257
Now that we have a trained model, we need to generate an inference graph that can be used to run the model.
258258

259-
> Note: There is currently an [issue](https://github.com/tensorflow/models/issues/8841) that occurs when you're trying to export the model. As a temporary fix, Github user [Jacobsolawetz](https://github.com/Jacobsolawetz) discovered that you can add ```if not isinstance(x, str):``` add line 140 of the ```https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/utils/tf_utils.py``` script. For more information, check out [his comment on the issue](https://github.com/tensorflow/models/issues/8841#issuecomment-657647648).
260-
261259
```bash
262260
python /content/models/research/object_detection/exporter_main_v2.py \
263261
--trained_checkpoint_dir training \

Diff for: Tensorflow_2_Object_Detection_Train_model.ipynb

-44
Original file line numberDiff line numberDiff line change
@@ -2325,50 +2325,6 @@
23252325
"## Export model inference graph"
23262326
]
23272327
},
2328-
{
2329-
"cell_type": "markdown",
2330-
"metadata": {
2331-
"id": "6rYr6VKH8_QU",
2332-
"colab_type": "text"
2333-
},
2334-
"source": [
2335-
"The below code cell adds a line to the tf_utils.py file. This is a temporary fix to a [exporting issue](https://github.com/tensorflow/models/issues/8841) occuring when using the OD API with Tensorflow 2. This code will be removed as soon as the OD Team puts out a fix.\n",
2336-
"\n",
2337-
"All credit goes to Github user [Jacobsolawetz](https://github.com/Jacobsolawetz), who provided this [temporary fix](https://github.com/tensorflow/models/issues/8841#issuecomment-657647648)."
2338-
]
2339-
},
2340-
{
2341-
"cell_type": "code",
2342-
"metadata": {
2343-
"id": "Usv5FMT1xG1L",
2344-
"colab_type": "code",
2345-
"colab": {
2346-
"base_uri": "https://localhost:8080/",
2347-
"height": 34
2348-
},
2349-
"outputId": "a51d45a9-c90f-4b78-e323-8a6c69217f7f"
2350-
},
2351-
"source": [
2352-
"with open('/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/utils/tf_utils.py') as f:\n",
2353-
" tf_utils = f.read()\n",
2354-
"\n",
2355-
"with open('/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/utils/tf_utils.py', 'w') as f:\n",
2356-
" # Set labelmap path\n",
2357-
" throw_statement = \"raise TypeError('Expected Operation, Variable, or Tensor, got ' + str(x))\"\n",
2358-
" tf_utils = tf_utils.replace(throw_statement, \"if not isinstance(x, str):\" + throw_statement)\n",
2359-
" f.write(tf_utils)"
2360-
],
2361-
"execution_count": 22,
2362-
"outputs": [
2363-
{
2364-
"output_type": "stream",
2365-
"text": [
2366-
"Overwriting /usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/utils/tf_utils.py\n"
2367-
],
2368-
"name": "stdout"
2369-
}
2370-
]
2371-
},
23722328
{
23732329
"cell_type": "code",
23742330
"metadata": {

0 commit comments

Comments
 (0)