Skip to content

Commit

Permalink
multigpu training compatibility with the test script
Browse files Browse the repository at this point in the history
  • Loading branch information
taesungp committed Sep 14, 2020
1 parent c0c39ab commit e4cf3d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@
webpage = html.HTML(web_dir, 'Experiment = %s, Phase = %s, Epoch = %s' % (opt.name, opt.phase, opt.epoch))

for i, data in enumerate(dataset):
model.set_input(data) # unpack data from data loader
if i == 0:
model.data_dependent_initialize()
model.data_dependent_initialize(data)
model.setup(opt) # regular setup: load and print networks; create schedulers
model.parallelize()
if opt.eval:
model.eval()
if i >= opt.num_test: # only apply our model to opt.num_test images.
break
model.set_input(data) # unpack data from data loader
model.test() # run inference
visuals = model.get_current_visuals() # get image results
img_path = model.get_image_paths() # get image paths
Expand Down

0 comments on commit e4cf3d8

Please sign in to comment.