Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
model_path: Path to models saved graph.
randomize: Start with random weights
labels_path: Path to models line separated class names text file.
Returns:
a model instance.
Raises:
ValueError: If model name is not valid.
"""
if model_to_run == 'InceptionV3':
mymodel = model.InceptionV3Wrapper_public(
sess, model_saved_path=model_path, labels_path=labels_path)
elif model_to_run == 'GoogleNet':
# common_typos_disable
mymodel = model.GoolgeNetWrapper_public(
sess, model_saved_path=model_path, labels_path=labels_path)
else:
raise ValueError('Invalid model name')
if randomize: # randomize the network!
sess.run(tf.global_variables_initializer())
return mymodel