def InferenceNet(): assert os.path.exists(args.val_data_dir) print("Loading data from {}".format(args.val_data_dir)) (labels, images) = ofrecord_util.load_imagenet_for_validation(args) logits = model_dict[args.model](images, args) predictions = flow.nn.softmax(logits) outputs = {"predictions": predictions, "labels": labels} return outputs
def InferenceNet(): if args.val_data_dir: assert os.path.exists(args.val_data_dir) print("Loading data from {}".format(args.val_data_dir)) (labels, images) = ofrecord_util.load_imagenet_for_validation(args) else: print("Loading synthetic data.") (labels, images) = ofrecord_util.load_synthetic(args) logits = model_dict[args.model]( images, need_transpose=False if args.val_data_dir else True) predictions = flow.nn.softmax(logits) outputs = {"predictions": predictions, "labels": labels} return outputs