ea65d92a41ba1e8171cd0814dc9c50373f8e2c4f,eval_ch.py,,main,#,197
Before Change
log_packages=args.log_packages,
log_pip_packages=args.log_pip_packages)
ds_metainfo = get_dataset_metainfo(dataset_name=args.dataset)
ds_metainfo.update(args=args)
assert (ds_metainfo.ml_type != "imgseg") or (args.batch_size == 1)
assert (ds_metainfo.ml_type != "imgseg") or args.disable_cudnn_autotune
global_config.train = False
use_gpus = prepare_ch_context(args.num_gpus)
net = prepare_model(
model_name=args.model,
use_pretrained=args.use_pretrained,
pretrained_model_file_path=args.resume.strip(),
use_gpus=use_gpus,
net_extra_kwargs=ds_metainfo.net_extra_kwargs,
num_classes=args.num_classes,
in_channels=args.in_channels)
assert (hasattr(net, "classes"))
assert (hasattr(net, "in_size"))
if args.data_subset == "val":
get_test_data_source_class = get_val_data_source
test_metric = get_composite_metric(
metric_names=ds_metainfo.val_metric_names,
metric_extra_kwargs=ds_metainfo.val_metric_extra_kwargs)
else:
get_test_data_source_class = get_test_data_source
test_metric = get_composite_metric(
metric_names=ds_metainfo.test_metric_names,
metric_extra_kwargs=ds_metainfo.test_metric_extra_kwargs)
test_data = get_test_data_source_class(
ds_metainfo=ds_metainfo,
batch_size=args.batch_size,
num_workers=args.num_workers)
After Change
if args.all:
args.use_pretrained = True
for model_name, model_metainfo in (_model_sha1.items() if version_info[0] >= 3 else _model_sha1.iteritems()):
error, checksum, repo_release_tag = model_metainfo
args.model = model_name
logging.info("==============")
logging.info("Checking model: {}".format(model_name))
acc_value = test_model(args=args)
if acc_value is not None:
exp_value = int(error) * 1e-4
if abs(acc_value - exp_value) > 2e-4:
logging.info("----> Wrong value detected (expected value: {})!".format(exp_value))
else:
test_model(args=args)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 10
Instances
Project Name: osmr/imgclsmob
Commit Name: ea65d92a41ba1e8171cd0814dc9c50373f8e2c4f
Time: 2020-01-16
Author: osemery@gmail.com
File Name: eval_ch.py
Class Name:
Method Name: main
Project Name: mynlp/ccg2lambda
Commit Name: 5b5d9a9aedf8e11b9609d28b26b6488bc20cb08b
Time: 2017-03-24
Author: pascual@nii.ac.jp
File Name: scripts/semantic_types.py
Class Name:
Method Name: merge_dynamic_libraries
Project Name: jaakkopasanen/AutoEq
Commit Name: e6f1028be471f2ba7fdf877abf7f8f9d05b8c4ce
Time: 2018-08-06
Author: jaakko.o.pasanen@gmail.com
File Name: results/recommendations.py
Class Name:
Method Name: get_urls