Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionError: Invalid type <enum 'TrianingMode'> for key MODE; valid types = {<class 'tuple'>, <class 'list'>, <class 'int'>, <class 'float'>, <class 'bool'>, <class 'str'>, <class 'NoneType'>} #49

Open
omiderfanmanesh opened this issue May 27, 2021 · 0 comments

Comments

@omiderfanmanesh
Copy link

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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant