コード例 #1
0
 def create_session(self):
     scopes = list(get_model_scopes())
     if global_variables(scopes) is None or\
             len(global_variables(scopes)) == 0:
         return
     execute_with_retry(variable_registers(scopes))
     execute_with_retry(global_initializers(scopes))
コード例 #2
0
 def create_session(self):
     if global_variables() is None or len(global_variables()) == 0:
         return
     execute_with_retry(variable_registers())
     var_set = set(global_variables())
     while len(var_set) > 0:
         for var in global_variables():
             if var not in var_set:
                 continue
             inited = execute_with_retry([var.is_initialized_op])
             if inited == [1]:
                 var_set.remove(var)
             else:
                 print('waiting for initialize variable[%s]' % var.name)
         if is_local_mode():
             time.sleep(0.1)
         else:
             time.sleep(3)
コード例 #3
0
 def create_session(self):
     if global_variables() is None or\
             len(global_variables()) == 0:
         return
     execute_with_retry(variable_registers())
     execute_with_retry(global_initializers())