Skip to content

Commit

Permalink
Training Tests: Specify -save.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Amos committed Jun 13, 2016
1 parent c04386c commit 2bad4e5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/openface_neural_net_training_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def test_dnn_training():
assert p.returncode == 0

netWorkDir = tempfile.mkdtemp(prefix='OpenFaceTrainingTest-Net-')
saveDir = os.path.join(netWorkDir, '1')
cmd = ['th', './main.lua',
'-data', os.path.join(imgWorkDir, 'aligned'),
'-modelDef', '../models/openface/nn4.def.lua',
Expand All @@ -64,6 +65,7 @@ def test_dnn_training():
'-nEpochs', '10',
'-epochSize', '1',
'-cache', netWorkDir,
'-save', saveDir,
'-cuda', '-cudnn', '-testing',
'-nDonkeys', '-1']
p = Popen(cmd, stdout=PIPE, stderr=PIPE,
Expand All @@ -74,9 +76,8 @@ def test_dnn_training():
assert p.returncode == 0

# Training won't make much progress on lfw-subset, but as a sanity check,
# make sure the training code runs and doesn't get worse than the initialize
# loss value of 0.2.
trainLoss = pd.read_csv(os.path.join(netWorkDir, '001', 'train.log'),
# make sure the training code runs and doesn't get worse than 0.2.
trainLoss = pd.read_csv(os.path.join(saveDir, 'train.log'),
sep='\t').as_matrix()[:, 0]
assert np.mean(trainLoss) < 0.3

Expand Down

0 comments on commit 2bad4e5

Please sign in to comment.