Skip to content

Commit 1ea48fb

Browse files
author
Stanislav Pidhorskyi
committed
Batch size adjustments
1 parent 4e6cdcd commit 1ea48fb

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

metrics/fid_rec.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ def sample(cfg, logger):
179179
decoder = nn.DataParallel(decoder)
180180

181181
with torch.no_grad():
182-
ppl = FID(cfg, num_images=50000, minibatch_size=8 * torch.cuda.device_count())
182+
ppl = FID(cfg, num_images=50000, minibatch_size=16 * torch.cuda.device_count())
183183
ppl.evaluate(logger, mapping_fl, decoder, encoder, cfg.DATASET.MAX_RESOLUTION_LEVEL - 2)
184184

185185

metrics/fid_sep.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import utils
2828

2929
dnnlib.tflib.init_tf()
30-
tf_config = {'rnd.np_random_seed': 1000}
3130

3231
download.from_google_drive('1CIDc9i070KQhHlkr4yIwoJC8xqrwjE0_', directory="metrics")
3332

metrics/lpips.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
# Copyright 2019-2020 Stanislav Pidhorskyi
22
#
3-
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
46
#
5-
# This work is licensed under the Creative Commons Attribution-NonCommercial
6-
# 4.0 International License. To view a copy of this license, visit
7-
# http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to
8-
# Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
# ==============================================================================
915

10-
"""Perceptual Path Length (PPL)."""
1116

1217
import dnnlib.tflib
1318
import pickle
@@ -28,7 +33,6 @@
2833
import utils
2934

3035
dnnlib.tflib.init_tf()
31-
tf_config = {'rnd.np_random_seed': 1000}
3236

3337
download.from_google_drive('1CIDc9i070KQhHlkr4yIwoJC8xqrwjE0_', directory="metrics")
3438

@@ -145,7 +149,7 @@ def sample(cfg, logger):
145149
encoder = nn.DataParallel(encoder)
146150

147151
with torch.no_grad():
148-
ppl = LPIPS(cfg, num_images=10000, minibatch_size=8 * torch.cuda.device_count())
152+
ppl = LPIPS(cfg, num_images=10000, minibatch_size=16 * torch.cuda.device_count())
149153
ppl.evaluate(logger, mapping_fl, decoder, encoder, cfg.DATASET.MAX_RESOLUTION_LEVEL - 2)
150154

151155

0 commit comments

Comments
 (0)