예제 #1
0
파일: test.py 프로젝트: zfxu/DexiNed
    def setup(self, session):

        try:
            if self.args.model_name == 'DXN':
                self.model = dexined(self.args)
            else:
                print_error("Error setting model, {}".format(
                    self.args.model_name))
            if self.args.trained_model_dir is None:
                meta_model_file = os.path.join(
                    self.args.checkpoint_dir,
                    os.path.join(
                        self.args.model_name + '_' + self.args.train_dataset,
                        os.path.join(
                            'train', '{}-{}'.format(self.args.model_name,
                                                    self.args.test_snapshot))))
            else:
                meta_model_file = os.path.join(
                    self.args.checkpoint_dir,
                    os.path.join(
                        self.args.model_name + '_' + self.args.train_dataset,
                        os.path.join(
                            self.args.trained_model_dir,
                            '{}-{}'.format(self.args.model_name,
                                           self.args.test_snapshot))))

            saver = tf.train.Saver()
            saver.restore(session, meta_model_file)
            print_info(
                'Done restoring DexiNed model from {}'.format(meta_model_file))

        except Exception as err:

            print_error(
                'Error setting up DexiNed traied model, {}'.format(err))
예제 #2
0
파일: train.py 프로젝트: xiaozr/DexiNed
    def setup(self):
        try:
            if self.args.model_name=='DXN':
                self.model = dexined(self.args)
            else:
                print_error("Error setting model, {}".format(self.args.model_name))

            print_info("DL model Set")
        except Exception as err:
            print_error("Error setting up DL model, {}".format(err))
            self.init=False