Skip to content

Commit 8beb5eb

Browse files
committed
updated generate_tfrecord.py to work with tensorflow 2
1 parent 6e1d0d8 commit 8beb5eb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

generate_tfrecord.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
import os
66
import io
77
import pandas as pd
8-
import tensorflow as tf
8+
9+
from tensorflow.python.framework.versions import VERSION
10+
if VERSION >= "2.0.0a0":
11+
import tensorflow.compat.v1 as tf
12+
else:
13+
import tensorflow as tf
914

1015
from PIL import Image
1116
from object_detection.utils import dataset_util

0 commit comments

Comments
 (0)