Analog zur Erstellung des Trainingsmodells können wir mit den gleichen Funktionen auch das entsprechende Modell für den Test unserer Testdaten erzeugen:
In [25]: test_model = cnn.CNNModelHelper(
order="NCHW",
name="mnist_test",
init_params=False)
data, label = CreateInput(
test_model,
batch_size=100,
db=os.path.join(base_path, 'mnist-test-nchw-leveldb'),
db_type='leveldb')
softmax = CreateLeNetModel(test_model, data)
CreateAccuracy(test_model, softmax, label)
In [26]: deploy_model = cnn.CNNModelHelper(order="NCHW", name="mnist_deploy_
model", init_params=False)
CreateLeNetModel(deploy_model, "data")
Das eigentliche Training des Modells wird mithilfe eines Caffe2-Workspace realisiert. Die Workspace-Struktur wird dabei mit dem Trainingsmodell ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access