Skip to content

Commit

Permalink
Bugfixes for lmdb_data_source, trainer
Browse files Browse the repository at this point in the history
  • Loading branch information
achalddave committed Nov 29, 2017
1 parent 56e9d8c commit 49eec07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lmdb_data_source.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ local data_source = require 'data_source'
local DiskFramesHdf5LabelsDataSource =
data_source.DiskFramesHdf5LabelsDataSource

local video_frame_proto = require 'video_util.video_frames_pb'
local video_frame_proto = require 'video_util.util.video_frames_pb'

local VideoDataSource = data_source.VideoDataSource
-- TODO(achald): Update these older data sources to use an options as input,
-- then update all callers to pass options instead of separate arguments. This
-- way we can specify the options generally in a config file.
Expand Down
6 changes: 3 additions & 3 deletions trainer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require 'nnlr'
local evaluator = require 'evaluator'
local image_util = require 'util/image_util'
local log = require 'util/log'
local END_OF_SEQUENCE = require('data_loader').END_OF_SEQUENCE
local END_OF_SEQUENCE = require('data_source').END_OF_SEQUENCE

local Trainer = classic.class('Trainer')

Expand Down Expand Up @@ -513,7 +513,7 @@ function SequentialTrainer:_train_or_evaluate_batch(train_mode)
-- The sequence ended at the end of the last batch; reset the model and
-- start loading the next sequence in the next batch.
for step = 1, #images_table do
-- The rest of the batch should be filled with END_OF_SEQUENCe.
-- The rest of the batch should be filled with END_OF_SEQUENCE.
assert(images_table[step][1] == END_OF_SEQUENCE)
end
self.model:forget()
Expand Down Expand Up @@ -549,7 +549,7 @@ function SequentialTrainer:_train_or_evaluate_batch(train_mode)
labels = labels[{{1, num_valid_steps}}]
images = images[{{1, num_valid_steps}}]
for step = num_valid_steps + 1, #images_table do
-- The rest of the batch should be filled with END_OF_SEQUENCe.
-- The rest of the batch should be filled with END_OF_SEQUENCE.
assert(images_table[step][1] == END_OF_SEQUENCE)
end
end
Expand Down

0 comments on commit 49eec07

Please sign in to comment.