Skip to content

Commit

Permalink
Check for the Python version and fail if using Python 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ljanyst committed Feb 3, 2019
1 parent a1d02bd commit 4e39bdd
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
from utils import draw_box
from tqdm import tqdm

if sys.version_info[0] < 3:
print("This is a Python 3 program. Use Python 3 or higher.")
sys.exit(1)

#-------------------------------------------------------------------------------
# Start the show
#-------------------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions export_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@

from tensorflow.python.framework import graph_util

if sys.version_info[0] < 3:
print("This is a Python 3 program. Use Python 3 or higher.")
sys.exit(1)

#---------------------------------------------------------------------------
# Parse the commandline
#---------------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
from utils import str2bool, load_data_source, draw_box
from tqdm import tqdm

if sys.version_info[0] < 3:
print("This is a Python 3 program. Use Python 3 or higher.")
sys.exit(1)

#-------------------------------------------------------------------------------
def sample_generator(samples, image_size, batch_size):
image_size = (image_size.w, image_size.h)
Expand Down
4 changes: 4 additions & 0 deletions process_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
from utils import load_data_source, str2bool, draw_box
from tqdm import tqdm

if sys.version_info[0] < 3:
print("This is a Python 3 program. Use Python 3 or higher.")
sys.exit(1)

#-------------------------------------------------------------------------------
def annotate(data_dir, samples, colors, sample_name):
"""
Expand Down
4 changes: 4 additions & 0 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
from utils import *
from tqdm import tqdm

if sys.version_info[0] < 3:
print("This is a Python 3 program. Use Python 3 or higher.")
sys.exit(1)

#-------------------------------------------------------------------------------
def compute_lr(lr_values, lr_boundaries):
with tf.variable_scope('learning_rate'):
Expand Down

0 comments on commit 4e39bdd

Please sign in to comment.