@@ -161,13 +161,12 @@ def build_model(images,
161161 f .write ('global_params= %s\n \n ' % str (global_params ))
162162 f .write ('blocks_args= %s\n \n ' % str (blocks_args ))
163163
164- with tf .variable_scope (model_name ):
165- model = efficientnet_model .Model (blocks_args , global_params )
166- outputs = model (
167- images ,
168- training = training ,
169- features_only = features_only ,
170- pooled_features_only = pooled_features_only )
164+ model = efficientnet_model .Model (blocks_args , global_params , model_name )
165+ outputs = model (
166+ images ,
167+ training = training ,
168+ features_only = features_only ,
169+ pooled_features_only = pooled_features_only )
171170 if features_only :
172171 outputs = tf .identity (outputs , 'features' )
173172 elif pooled_features_only :
@@ -202,9 +201,8 @@ def build_model_base(images, model_name, training, override_params=None):
202201
203202 blocks_args , global_params = get_model_params (model_name , override_params )
204203
205- with tf .variable_scope (model_name ):
206- model = efficientnet_model .Model (blocks_args , global_params )
207- features = model (images , training = training , features_only = True )
204+ model = efficientnet_model .Model (blocks_args , global_params , model_name )
205+ features = model (images , training = training , features_only = True )
208206
209207 features = tf .identity (features , 'features' )
210208 return features , model .endpoints
0 commit comments