yacs
yacs copied to clipboard
AssertionError: Invalid type <enum 'TrianingMode'> for key MODE; valid types = {<class 'tuple'>, <class 'list'>, <class 'int'>, <class 'float'>, <class 'bool'>, <class 'str'>, <class 'NoneType'>}
I am going to use ENUM class in my config file and I got this error. my code is
from utils import MetricsType, TrianingMode
from yacs.config import CfgNode as CN
# -----------------------------------------------------------------------------
# Config definition
# -----------------------------------------------------------------------------
_C = CN()
_C.MODEL = CN()
_C.MODEL.NUM_CLASSES = 2
# -----------------------------------------------------------------------------
# INPUT
# -----------------------------------------------------------------------------
_C.INPUT = CN()
# -----------------------------------------------------------------------------
# Dataset
# -----------------------------------------------------------------------------
_C.DATASET = CN()
_C.DATASET.DATASET_ADDRESS = '../data/bank/bank.csv'
_C.DATASET.DATASET_BRIEF_DESCRIPTION = '../data/bank/description.txt'
_C.DATASET.TARGET = 'y'
# ---------------------------------------------------------------------------- #
# Models
# ---------------------------------------------------------------------------- #
_C.SVM = CN()
_C.SVM.NAME = 'SVM'
_C.SVM.MODE = TrianingMode.CLASSIFICATION
_C.SVM.KERNEL = 'rbf'
_C.SVM.GAMMA = 'scale'
_C.SVM.VERBOSE = True
# ---------------------------------------------------------------------------- #
# metric
# ---------------------------------------------------------------------------- #
_C.METRIC = CN()
_C.METRIC = MetricsType.F1_SCORE_MACRO
_C.CONFUSION_MATRIX = True
# ---------------------------------------------------------------------------- #
# Misc options
# ---------------------------------------------------------------------------- #
# _C.OUTPUT_DIR = "../outputs"