src/model/ddpg/ddpg.py
def initialize(self, load_weights=True, verbose=True):
        """ Load training history from path. To be add feature to just load weights, not training states

        """
        if load_weights:
            try:
                variables = tf.global_variables()
                param_dict = {}
                saver = tf.train.Saver()
                saver.restore(self.sess, self.model_save_path)
                for var in variables:
                    var_name = var.name[:-2]
                    if verbose:
                        print('Loading {} from checkpoint. Name: {}'.format(var.name, var_name))
                    param_dict[var_name] = var
            except:
                traceback.print_exc()
                print('Build model from scratch')
                self.sess.run(tf.global_variables_initializer())
        else:
            print('Build model from scratch')
            self.sess.run(tf.global_variables_initializer())
 Load training history from path. To be add feature to just load weights, not training states

        
Load training history from path. To be add feature to just load weights, not training states
Load training history from path . To be add feature to just load weights not training states
def initialize(self, load_weights=True, verbose=True):
        if load_weights:
            try:
                variables = tf.global_variables()
                param_dict = {}
                saver = tf.train.Saver()
                saver.restore(self.sess, self.model_save_path)
                for var in variables:
                    var_name = var.name[:-2]
                    if verbose:
                        print('Loading {} from checkpoint. Name: {}'.format(var.name, var_name))
                    param_dict[var_name] = var
            except:
                traceback.print_exc()
                print('Build model from scratch')
                self.sess.run(tf.global_variables_initializer())
        else:
            print('Build model from scratch')
            self.sess.run(tf.global_variables_initializer())
def initialize ( self , load_weights = True , verbose = True ) : if load_weights : try : variables = tf . global_variables ( ) param_dict = { } saver = tf . train . Saver ( ) saver . restore ( self . sess , self . model_save_path ) for var in variables : var_name = var . name [ : - 2 ] if verbose : print ( 'Loading {} from checkpoint. Name: {}' . format ( var . name , var_name ) ) param_dict [ var_name ] = var except : traceback . print_exc ( ) print ( 'Build model from scratch' ) self . sess . run ( tf . global_variables_initializer ( ) ) else : print ( 'Build model from scratch' ) self . sess . run ( tf . global_variables_initializer ( ) )
Load training history from path.
Load training history from path .
""" Load training history from path. To be add feature to just load weights, not training states

        """
self
load_weights
verbose