HRNet-Semantic-Segmentation icon indicating copy to clipboard operation
HRNet-Semantic-Segmentation copied to clipboard

Question about the function "eval"?

Open MrCrazyCrab opened this issue 4 years ago • 1 comments

When i run the code to test_dataset = eval('datasets.'+config.DATASET.DATASET)( root=config.DATASET.ROOT, list_path=config.DATASET.TEST_SET, num_samples=None, num_classes=config.DATASET.NUM_CLASSES, multi_scale=False, flip=False, ignore_label=config.TRAIN.IGNORE_LABEL, base_size=config.TEST.BASE_SIZE, crop_size=test_size, downsample_rate=1) what the function of eval? i cannot find any information about it, and i met the problem "EOFError: Ran out of input" in for index, batch in enumerate(tqdm(testloader)): image, label, _, name, *border_padding = batch size = label.size() which means the testloader doesnot contain any data. But i can not debug it for i don't know the function of eval.

MrCrazyCrab avatar Oct 21 '20 08:10 MrCrazyCrab

Eval is a python built-in function. As detailed here, the eval() method parses the expression passed to this method and runs python expression within the program.

Basically, eval will run the function named by the string config.DATASET.DATASET defined in datasets.py

HugoMichard avatar Oct 29 '20 13:10 HugoMichard