Skip to content

Commit

Permalink
remove batchSize in test.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
junyanz committed Apr 4, 2017
1 parent 306d066 commit 4a65a38
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
8 changes: 0 additions & 8 deletions models/one_direction_test_model.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ function OneDirectionTestModel:Initialize(opt)
self.real_A = torch.Tensor(opt.batchSize, opt.input_nc, opt.fineSize, opt.fineSize)

-- load/define models
local use_lsgan = ((opt.use_lsgan ~= nil) and (opt.use_lsgan == 1))
if not use_lsgan then
self.criterionGAN = nn.BCECriterion()
else
self.criterionGAN = nn.MSECriterion()
end
self.criterionRec = nn.AbsCriterion()

self.netG_A = util.load_test_model('G', opt)

self:RefreshParameters()
Expand Down
1 change: 0 additions & 1 deletion options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ local opt_train = {
-- options for test
opt_test = {
DATA_ROOT = '', -- path to images (should have subfolders 'train', 'val', etc)
batchSize = 1, -- # images in batch
loadSize = 256, -- scale images to this size
fineSize = 256, -- then crop to this size
flip = 0, -- horizontal mirroring data augmentation
Expand Down
4 changes: 2 additions & 2 deletions test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ s2 = opt.fineSize / opt.aspect_ratio

visuals = {}

for n = 1, math.floor(opt.how_many/opt.batchSize) do
for n = 1, math.floor(opt.how_many) do
print('processing batch ' .. n)
local cur_dataA, cur_dataB, cur_pathsA, cur_pathsB = data_loader:GetNextBatch()

Expand Down Expand Up @@ -130,7 +130,7 @@ for i = 1, #labels do
end
io.write('</tr>')

for n = 1,math.floor(opt.how_many/opt.batchSize) do
for n = 1,math.floor(opt.how_many) do
io.write('<tr>')
io.write('<td>' .. tostring(n) .. '</td>')
for j = 1, #labels do
Expand Down

0 comments on commit 4a65a38

Please sign in to comment.