def check_type(*args):
     if not check_type.__warning_sent__:
         from ppdet.utils.cli import ColorTTY
         color_tty = ColorTTY()
         message = "typeguard is not installed," \
             + "type checking is not available"
         print(color_tty.yellow(message))
         check_type.__warning_sent__ = True
 def doc_parse(*args):
     if not doc_parse.__warning_sent__:
         from ppdet.utils.cli import ColorTTY
         color_tty = ColorTTY()
         message = "docstring_parser is not installed, " \
             + "argument description is not available"
         print(color_tty.yellow(message))
         doc_parse.__warning_sent__ = True
Example #3
0
    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()

try:
    from docstring_parser import parse as doc_parse
except Exception:
    message = "docstring_parser is not installed, " \
        + "argument description is not available"
    print(color_tty.yellow(message))

try:
    from typeguard import check_type
except Exception:
    message = "typeguard is not installed," \
        + "type checking is not available"
    print(color_tty.yellow(message))
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import print_function

import re
import sys
from argparse import ArgumentParser, RawDescriptionHelpFormatter

import yaml

from ppdet.core.workspace import get_registered_modules, load_config
from ppdet.utils.cli import ColorTTY

color_tty = ColorTTY()

MISC_CONFIG = {
    "architecture": "<value>",
    "max_iters": "<value>",
    "train_feed": "<value>",
    "eval_feed": "<value>",
    "test_feed": "<value>",
    "pretrain_weights": "<value>",
    "save_dir": "<value>",
    "weights": "<value>",
    "metric": "<value>",
    "log_smooth_window": 20,
    "snapshot_iter": 10000,
    "use_gpu": True,
}