未验证 提交 e9b81b41 编写于 作者: K Kaipeng Deng 提交者: GitHub

add static notice (#2422)

* add static notice
上级 de808d9c
......@@ -22,24 +22,38 @@ parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 3)))
if parent_path not in sys.path:
sys.path.append(parent_path)
import logging
FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
import numpy as np
from collections import OrderedDict
from paddleslim.dist.single_distiller import merge, l2_loss
import paddle
from paddle import fluid
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.data.reader import create_reader
from ppdet.utils.eval_utils import parse_fetches, eval_results, eval_run
from ppdet.utils.stats import TrainingStats
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
import ppdet.utils.checkpoint as checkpoint
import logging
FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
try:
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.data.reader import create_reader
from ppdet.utils.eval_utils import parse_fetches, eval_results, eval_run
from ppdet.utils.stats import TrainingStats
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
import ppdet.utils.checkpoint as checkpoint
except ImportError as e:
if sys.argv[0].find('static') >= 0:
logger.error("Importing ppdet failed when running static model "
"with error: {}\n"
"please try:\n"
"\t1. run static model under PaddleDetection/static "
"directory\n"
"\t2. run 'pip uninstall ppdet' to uninstall ppdet "
"dynamic version firstly.".format(e))
sys.exit(-1)
else:
raise e
def l2_distill(pairs, weight):
......
......@@ -23,6 +23,11 @@ parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 4)))
if parent_path not in sys.path:
sys.path.append(parent_path)
import logging
FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
import numpy as np
from collections import OrderedDict
from paddleslim.dist.single_distiller import merge, l2_loss
......@@ -31,18 +36,27 @@ from paddleslim.analysis import flops
import paddle
from paddle import fluid
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.data.reader import create_reader
from ppdet.utils.eval_utils import parse_fetches, eval_results, eval_run
from ppdet.utils.stats import TrainingStats
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
import ppdet.utils.checkpoint as checkpoint
import logging
FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
try:
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.data.reader import create_reader
from ppdet.utils.eval_utils import parse_fetches, eval_results, eval_run
from ppdet.utils.stats import TrainingStats
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
import ppdet.utils.checkpoint as checkpoint
except ImportError as e:
if sys.argv[0].find('static') >= 0:
logger.error("Importing ppdet failed when running static model "
"with error: {}\n"
"please try:\n"
"\t1. run static model under PaddleDetection/static "
"directory\n"
"\t2. run 'pip uninstall ppdet' to uninstall ppdet "
"dynamic version firstly.".format(e))
sys.exit(-1)
else:
raise e
def split_distill(split_output_names, weight, target_number):
......
......@@ -30,25 +30,39 @@ from collections import deque
import paddle
from paddle import fluid
from ppdet.experimental import mixed_precision_context
from ppdet.core.workspace import load_config, merge_config, create, register
from ppdet.data.reader import create_reader
from ppdet.utils import dist_utils
from ppdet.utils.eval_utils import parse_fetches, eval_run
from ppdet.utils.stats import TrainingStats
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
import ppdet.utils.checkpoint as checkpoint
from paddleslim.analysis import flops, TableLatencyEvaluator
from paddleslim.nas import SANAS
import search_space
import logging
FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
try:
from ppdet.experimental import mixed_precision_context
from ppdet.core.workspace import load_config, merge_config, create, register
from ppdet.data.reader import create_reader
from ppdet.utils import dist_utils
from ppdet.utils.eval_utils import parse_fetches, eval_run
from ppdet.utils.stats import TrainingStats
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
import ppdet.utils.checkpoint as checkpoint
except ImportError as e:
if sys.argv[0].find('static') >= 0:
logger.error("Importing ppdet failed when running static model "
"with error: {}\n"
"please try:\n"
"\t1. run static model under PaddleDetection/static "
"directory\n"
"\t2. run 'pip uninstall ppdet' to uninstall ppdet "
"dynamic version firstly.".format(e))
sys.exit(-1)
else:
raise e
from paddleslim.analysis import flops, TableLatencyEvaluator
from paddleslim.nas import SANAS
import search_space
@register
class Constraint(object):
......
......@@ -28,20 +28,33 @@ import paddle.fluid as fluid
from paddleslim.prune import Pruner
from paddleslim.analysis import flops
from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results, json_eval_results
import ppdet.utils.checkpoint as checkpoint
from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
from ppdet.data.reader import create_reader
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.cli import ArgsParser
import logging
FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
try:
from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results, json_eval_results
import ppdet.utils.checkpoint as checkpoint
from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
from ppdet.data.reader import create_reader
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.cli import ArgsParser
except ImportError as e:
if sys.argv[0].find('static') >= 0:
logger.error("Importing ppdet failed when running static model "
"with error: {}\n"
"please try:\n"
"\t1. run static model under PaddleDetection/static "
"directory\n"
"\t2. run 'pip uninstall ppdet' to uninstall ppdet "
"dynamic version firstly.".format(e))
sys.exit(-1)
else:
raise e
def main():
"""
......
......@@ -25,19 +25,33 @@ if parent_path not in sys.path:
import paddle
from paddle import fluid
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.cli import ArgsParser
import ppdet.utils.checkpoint as checkpoint
from ppdet.utils.export_utils import save_infer_model, dump_infer_config
from ppdet.utils.check import check_config, check_version, enable_static_mode
from paddleslim.prune import Pruner
from paddleslim.analysis import flops
import logging
FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
try:
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.cli import ArgsParser
import ppdet.utils.checkpoint as checkpoint
from ppdet.utils.export_utils import save_infer_model, dump_infer_config
from ppdet.utils.check import check_config, check_version, enable_static_mode
except ImportError as e:
if sys.argv[0].find('static') >= 0:
logger.error("Importing ppdet failed when running static model "
"with error: {}\n"
"please try:\n"
"\t1. run static model under PaddleDetection/static "
"directory\n"
"\t2. run 'pip uninstall ppdet' to uninstall ppdet "
"dynamic version firstly.".format(e))
sys.exit(-1)
else:
raise e
from paddleslim.prune import Pruner
from paddleslim.analysis import flops
def main():
cfg = load_config(FLAGS.config)
......
......@@ -32,21 +32,34 @@ from paddleslim.analysis import flops
import paddle
from paddle import fluid
from ppdet.experimental import mixed_precision_context
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.data.reader import create_reader
from ppdet.utils import dist_utils
from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results
from ppdet.utils.stats import TrainingStats
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
import ppdet.utils.checkpoint as checkpoint
import logging
FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
try:
from ppdet.experimental import mixed_precision_context
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.data.reader import create_reader
from ppdet.utils import dist_utils
from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results
from ppdet.utils.stats import TrainingStats
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
import ppdet.utils.checkpoint as checkpoint
except ImportError as e:
if sys.argv[0].find('static') >= 0:
logger.error("Importing ppdet failed when running static model "
"with error: {}\n"
"please try:\n"
"\t1. run static model under PaddleDetection/static "
"directory\n"
"\t2. run 'pip uninstall ppdet' to uninstall ppdet "
"dynamic version firstly.".format(e))
sys.exit(-1)
else:
raise e
def main():
env = os.environ
......
......@@ -26,20 +26,33 @@ if parent_path not in sys.path:
import paddle
import paddle.fluid as fluid
from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results, json_eval_results
import ppdet.utils.checkpoint as checkpoint
from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
from ppdet.data.reader import create_reader
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.cli import ArgsParser
import logging
FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
try:
from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results, json_eval_results
import ppdet.utils.checkpoint as checkpoint
from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
from ppdet.data.reader import create_reader
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.cli import ArgsParser
except ImportError as e:
if sys.argv[0].find('static') >= 0:
logger.error("Importing ppdet failed when running static model "
"with error: {}\n"
"please try:\n"
"\t1. run static model under PaddleDetection/static "
"directory\n"
"\t2. run 'pip uninstall ppdet' to uninstall ppdet "
"dynamic version firstly.".format(e))
sys.exit(-1)
else:
raise e
# import paddleslim
from paddleslim.quant import quant_aware, convert
......
......@@ -22,19 +22,33 @@ parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 3)))
if parent_path not in sys.path:
sys.path.append(parent_path)
import paddle
from paddle import fluid
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.cli import ArgsParser
import ppdet.utils.checkpoint as checkpoint
from ppdet.utils.export_utils import save_infer_model, dump_infer_config
from ppdet.utils.check import check_config, check_version, enable_static_mode
import logging
FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
import paddle
from paddle import fluid
try:
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.cli import ArgsParser
import ppdet.utils.checkpoint as checkpoint
from ppdet.utils.export_utils import save_infer_model, dump_infer_config
from ppdet.utils.check import check_config, check_version, enable_static_mode
except ImportError as e:
if sys.argv[0].find('static') >= 0:
logger.error("Importing ppdet failed when running static model "
"with error: {}\n"
"please try:\n"
"\t1. run static model under PaddleDetection/static "
"directory\n"
"\t2. run 'pip uninstall ppdet' to uninstall ppdet "
"dynamic version firstly.".format(e))
sys.exit(-1)
else:
raise e
from paddleslim.quant import quant_aware, convert
......
......@@ -29,19 +29,33 @@ from PIL import Image
import paddle
from paddle import fluid
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.eval_utils import parse_fetches
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
from ppdet.utils.visualizer import visualize_results
import ppdet.utils.checkpoint as checkpoint
from ppdet.data.reader import create_reader
from tools.infer import get_test_images, get_save_image_name
import logging
FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
try:
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.eval_utils import parse_fetches
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
from ppdet.utils.visualizer import visualize_results
import ppdet.utils.checkpoint as checkpoint
from ppdet.data.reader import create_reader
from tools.infer import get_test_images, get_save_image_name
except ImportError as e:
if sys.argv[0].find('static') >= 0:
logger.error("Importing ppdet failed when running static model "
"with error: {}\n"
"please try:\n"
"\t1. run static model under PaddleDetection/static "
"directory\n"
"\t2. run 'pip uninstall ppdet' to uninstall ppdet "
"dynamic version firstly.".format(e))
sys.exit(-1)
else:
raise e
from paddleslim.quant import quant_aware, convert
......
......@@ -31,21 +31,36 @@ import shutil
import paddle
from paddle import fluid
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.data.reader import create_reader
from ppdet.utils import dist_utils
from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results
from ppdet.utils.stats import TrainingStats
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
import ppdet.utils.checkpoint as checkpoint
from paddleslim.quant import quant_aware, convert
from pact import pact, get_optimizer
import logging
FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
try:
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.data.reader import create_reader
from ppdet.utils import dist_utils
from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results
from ppdet.utils.stats import TrainingStats
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
import ppdet.utils.checkpoint as checkpoint
except ImportError as e:
if sys.argv[0].find('static') >= 0:
logger.error("Importing ppdet failed when running static model "
"with error: {}\n"
"please try:\n"
"\t1. run static model under PaddleDetection/static "
"directory\n"
"\t2. run 'pip uninstall ppdet' to uninstall ppdet "
"dynamic version firstly.".format(e))
sys.exit(-1)
else:
raise e
from paddleslim.quant import quant_aware, convert
from pact import pact, get_optimizer
def save_checkpoint(exe, prog, path, train_prog):
if os.path.isdir(path):
......
......@@ -23,18 +23,32 @@ parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2)))
if parent_path not in sys.path:
sys.path.append(parent_path)
import logging
FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
from scipy.cluster.vq import kmeans
import random
import numpy as np
from tqdm import tqdm
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config
from ppdet.core.workspace import load_config, merge_config, create
import logging
FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
try:
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config
from ppdet.core.workspace import load_config, merge_config, create
except ImportError as e:
if sys.argv[0].find('static') >= 0:
logger.error("Importing ppdet failed when running static model "
"with error: {}\n"
"please try:\n"
"\t1. run static model under PaddleDetection/static "
"directory\n"
"\t2. run 'pip uninstall ppdet' to uninstall ppdet "
"dynamic version firstly.".format(e))
sys.exit(-1)
else:
raise e
class BaseAnchorCluster(object):
......
......@@ -23,10 +23,28 @@ parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2)))
if parent_path not in sys.path:
sys.path.append(parent_path)
import logging
FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
import yaml
from ppdet.core.workspace import get_registered_modules, load_config, dump_value
from ppdet.utils.cli import ColorTTY, print_total_cfg
try:
from ppdet.core.workspace import get_registered_modules, load_config, dump_value
from ppdet.utils.cli import ColorTTY, print_total_cfg
except ImportError as e:
if sys.argv[0].find('static') >= 0:
logger.error("Importing ppdet failed when running static model "
"with error: {}\n"
"please try:\n"
"\t1. run static model under PaddleDetection/static "
"directory\n"
"\t2. run 'pip uninstall ppdet' to uninstall ppdet "
"dynamic version firstly.".format(e))
sys.exit(-1)
else:
raise e
color_tty = ColorTTY()
......
......@@ -25,20 +25,33 @@ if parent_path not in sys.path:
import paddle
import paddle.fluid as fluid
from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results, json_eval_results
import ppdet.utils.checkpoint as checkpoint
from ppdet.utils.check import check_gpu, check_xpu, check_version, check_config, enable_static_mode
from ppdet.data.reader import create_reader
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.cli import ArgsParser
import logging
FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
try:
from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results, json_eval_results
import ppdet.utils.checkpoint as checkpoint
from ppdet.utils.check import check_gpu, check_xpu, check_version, check_config, enable_static_mode
from ppdet.data.reader import create_reader
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.cli import ArgsParser
except ImportError as e:
if sys.argv[0].find('static') >= 0:
logger.error("Importing ppdet failed when running static model "
"with error: {}\n"
"please try:\n"
"\t1. run static model under PaddleDetection/static "
"directory\n"
"\t2. run 'pip uninstall ppdet' to uninstall ppdet "
"dynamic version firstly.".format(e))
sys.exit(-1)
else:
raise e
def main():
"""
......
......@@ -26,16 +26,30 @@ if parent_path not in sys.path:
import paddle
from paddle import fluid
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.cli import ArgsParser
import ppdet.utils.checkpoint as checkpoint
from ppdet.utils.export_utils import save_infer_model, dump_infer_config
from ppdet.utils.check import check_config, check_version, check_py_func, enable_static_mode
import logging
FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
try:
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.cli import ArgsParser
import ppdet.utils.checkpoint as checkpoint
from ppdet.utils.export_utils import save_infer_model, dump_infer_config
from ppdet.utils.check import check_config, check_version, check_py_func, enable_static_mode
except ImportError as e:
if sys.argv[0].find('static') >= 0:
logger.error("Importing ppdet failed when running static model "
"with error: {}\n"
"please try:\n"
"\t1. run static model under PaddleDetection/static "
"directory\n"
"\t2. run 'pip uninstall ppdet' to uninstall ppdet "
"dynamic version firstly.".format(e))
sys.exit(-1)
else:
raise e
def main():
cfg = load_config(FLAGS.config)
......
......@@ -22,20 +22,34 @@ parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2)))
if parent_path not in sys.path:
sys.path.append(parent_path)
import yaml
import paddle
from paddle import fluid
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_config, check_version, enable_static_mode
import ppdet.utils.checkpoint as checkpoint
import yaml
import logging
from ppdet.utils.export_utils import dump_infer_config, prune_feed_vars
FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
try:
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_config, check_version, enable_static_mode
import ppdet.utils.checkpoint as checkpoint
from ppdet.utils.export_utils import dump_infer_config, prune_feed_vars
except ImportError as e:
if sys.argv[0].find('static') >= 0:
logger.error("Importing ppdet failed when running static model "
"with error: {}\n"
"please try:\n"
"\t1. run static model under PaddleDetection/static "
"directory\n"
"\t2. run 'pip uninstall ppdet' to uninstall ppdet "
"dynamic version firstly.".format(e))
sys.exit(-1)
else:
raise e
def save_serving_model(FLAGS, exe, feed_vars, test_fetches, infer_prog):
cfg_name = os.path.basename(FLAGS.config).split('.')[0]
......
......@@ -29,18 +29,31 @@ import numpy as np
import cv2
from collections import OrderedDict
import ppdet.utils.checkpoint as checkpoint
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
from ppdet.utils.widerface_eval_utils import get_shrink, bbox_vote, \
save_widerface_bboxes, save_fddb_bboxes, to_chw_bgr
from ppdet.core.workspace import load_config, merge_config, create
import logging
FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
try:
import ppdet.utils.checkpoint as checkpoint
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
from ppdet.utils.widerface_eval_utils import get_shrink, bbox_vote, \
save_widerface_bboxes, save_fddb_bboxes, to_chw_bgr
from ppdet.core.workspace import load_config, merge_config, create
except ImportError as e:
if sys.argv[0].find('static') >= 0:
logger.error("Importing ppdet failed when running static model "
"with error: {}\n"
"please try:\n"
"\t1. run static model under PaddleDetection/static "
"directory\n"
"\t2. run 'pip uninstall ppdet' to uninstall ppdet "
"dynamic version firstly.".format(e))
sys.exit(-1)
else:
raise e
def face_img_process(image,
mean=[104., 117., 123.],
......
......@@ -30,21 +30,34 @@ from PIL import Image, ImageOps
import paddle
from paddle import fluid
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.eval_utils import parse_fetches
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
from ppdet.utils.visualizer import visualize_results
import ppdet.utils.checkpoint as checkpoint
from ppdet.data.reader import create_reader
import logging
FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
try:
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.utils.eval_utils import parse_fetches
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
from ppdet.utils.visualizer import visualize_results
import ppdet.utils.checkpoint as checkpoint
from ppdet.data.reader import create_reader
except ImportError as e:
if sys.argv[0].find('static') >= 0:
logger.error("Importing ppdet failed when running static model "
"with error: {}\n"
"please try:\n"
"\t1. run static model under PaddleDetection/static "
"directory\n"
"\t2. run 'pip uninstall ppdet' to uninstall ppdet "
"dynamic version firstly.".format(e))
sys.exit(-1)
else:
raise e
def get_save_image_name(output_dir, image_path):
"""
......
......@@ -35,22 +35,35 @@ from paddle import fluid
from paddle.fluid.layers.learning_rate_scheduler import _decay_step_counter
from paddle.fluid.optimizer import ExponentialMovingAverage
from ppdet.experimental import mixed_precision_context
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.data.reader import create_reader
from ppdet.utils import dist_utils
from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results
from ppdet.utils.stats import TrainingStats
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_xpu, check_version, check_config, enable_static_mode
import ppdet.utils.checkpoint as checkpoint
import logging
FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
try:
from ppdet.experimental import mixed_precision_context
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.data.reader import create_reader
from ppdet.utils import dist_utils
from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results
from ppdet.utils.stats import TrainingStats
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_xpu, check_version, check_config, enable_static_mode
import ppdet.utils.checkpoint as checkpoint
except ImportError as e:
if sys.argv[0].find('static') >= 0:
logger.error("Importing ppdet failed when running static model "
"with error: {}\n"
"please try:\n"
"\t1. run static model under PaddleDetection/static "
"directory\n"
"\t2. run 'pip uninstall ppdet' to uninstall ppdet "
"dynamic version firstly.".format(e))
sys.exit(-1)
else:
raise e
def main():
env = os.environ
......
......@@ -22,6 +22,11 @@ parent_path = os.path.abspath(os.path.join(__file__, *(['..'] * 2)))
if parent_path not in sys.path:
sys.path.append(parent_path)
import logging
FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
import time
import numpy as np
import random
......@@ -35,24 +40,32 @@ from paddle import fluid
from paddle.fluid.layers.learning_rate_scheduler import _decay_step_counter
from paddle.fluid.optimizer import ExponentialMovingAverage
from ppdet.experimental import mixed_precision_context
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.data.reader import create_reader
from ppdet.utils import dist_utils
from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results
from ppdet.utils.stats import TrainingStats
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
import ppdet.utils.checkpoint as checkpoint
from paddle.fluid.incubate.fleet.collective import fleet, DistributedStrategy # new line 1
from paddle.fluid.incubate.fleet.base import role_maker # new line 2
import logging
FORMAT = '%(asctime)s-%(levelname)s: %(message)s'
logging.basicConfig(level=logging.INFO, format=FORMAT)
logger = logging.getLogger(__name__)
try:
from ppdet.experimental import mixed_precision_context
from ppdet.core.workspace import load_config, merge_config, create
from ppdet.data.reader import create_reader
from ppdet.utils import dist_utils
from ppdet.utils.eval_utils import parse_fetches, eval_run, eval_results
from ppdet.utils.stats import TrainingStats
from ppdet.utils.cli import ArgsParser
from ppdet.utils.check import check_gpu, check_version, check_config, enable_static_mode
import ppdet.utils.checkpoint as checkpoint
except ImportError as e:
if sys.argv[0].find('static') >= 0:
logger.error("Importing ppdet failed when running static model "
"with error: {}\n"
"please try:\n"
"\t1. run static model under PaddleDetection/static "
"directory\n"
"\t2. run 'pip uninstall ppdet' to uninstall ppdet "
"dynamic version firstly.".format(e))
sys.exit(-1)
else:
raise e
def main():
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册