コード例 #1
0
    def build_model(self):

        print('Building Test Network')
        with tf.variable_scope('network') as scope:
            self.train_model = None
            self.model = self.model(self.args)
            self.model.build()
            calculate_flops()
コード例 #2
0
    def build_model(self):

        if self.mode == 'train' or self.mode == 'overfit':  # validation phase
            with tf.variable_scope('network') as scope:
                self.model = self.model(self.args)
                self.model.build()

        #            print('Building Train Network')
        #            with tf.variable_scope('network') as scope:
        #                self.train_model = self.model(self.args, phase=0)
        #                self.train_model.build()
        #
        #            print('Building Test Network')
        #            with tf.variable_scope('network') as scope:
        #                scope.reuse_variables()
        #                self.test_model = self.model(self.args, phase=1)
        #                self.test_model.build()
        else:  # inference phase
            print('Building Test Network')
            with tf.variable_scope('network') as scope:
                self.train_model = None
                self.model = self.model(self.args)
                self.model.build()
                calculate_flops()
コード例 #3
0
ファイル: agent.py プロジェクト: hardjet/segmentation
    def build_model(self):

        if self.operator.name == 'Train':
            with tf.variable_scope('network') as scope:
                self.model = self.model(self.args)
                self.model.build()

            # print('Building Train Network')
            # with tf.variable_scope('network') as scope:
            #    self.train_model = self.model(self.args, phase=0)
            #    self.train_model.build()
            #
            # print('Building Test Network')
            # with tf.variable_scope('network') as scope:
            #    scope.reuse_variables()
            #    self.test_model = self.model(self.args, phase=1)
            #    self.test_model.build()
        else:  # inference phase
            print('Building Test Network')
            with tf.variable_scope('network') as scope:
                # self.train_model = None
                self.model = self.model(self.args)
                self.model.build()
                calculate_flops()