Support pb files in precise-test

This commit is contained in:
Matthew D. Scholefield 2018-04-26 19:04:05 -05:00
parent ef96763327
commit 989e29bb83

View File

@ -17,6 +17,7 @@ from collections import namedtuple
from prettyparse import create_parser
from precise.model import load_precise_model
from precise.network_runner import Listener
from precise.params import inject_params
from precise.train_data import TrainData
@ -24,7 +25,7 @@ usage = '''
Test a model against a dataset
:model str
Keras model file (.net) to test
Either Keras (.net) or TensorFlow (.pb) model to test
:-t --use-train
Evaluate training data instead of test data
@ -101,7 +102,7 @@ def main():
inputs, targets = train if args.use_train else test
filenames = sum(data.train_files if args.use_train else data.test_files, [])
predictions = load_precise_model(args.model).predict(inputs)
predictions = Listener.find_runner(args.model)(args.model).predict(inputs)
stats = calc_stats(filenames, targets, predictions)
print('Data:', data)