Skip to content

Commit d910336

Browse files
committed
Minimal syntax fix
1 parent 6a88d01 commit d910336

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Diff for: dl_lib/evaluation/sem_seg_evaluation.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import cv2
1313
from dl_lib.data import DatasetCatalog, MetadataCatalog
1414
from dl_lib.utils.comm import all_gather, is_main_process, synchronize
15-
from datasets.cityscapes.cityscapesscripts.helpers.labels import trainId2label
15+
from cityscapesscripts.helpers.labels import trainId2label
1616
from .evaluator import DatasetEvaluator
1717

1818

@@ -160,6 +160,9 @@ def evaluate(self):
160160

161161
# add flops calculation
162162
if len(self._real_flops) > 0 and len(self._expt_flops) > 0:
163+
self._real_flops = [x.item() for x in self._real_flops]
164+
self._expt_flops = [x.item() for x in self._expt_flops]
165+
163166
res["mean_real_flops"] = (sum(self._real_flops) / len(self._real_flops)) / 1e3
164167
res["max_real_flops"] = max(self._real_flops) / 1e3
165168
res["min_real_flops"] = min(self._real_flops) / 1e3

Diff for: dl_lib/modeling/meta_arch/dynamic4seg.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,13 @@ def forward(self, features, targets=None):
169169
for _index in range(len(self.in_features)):
170170
out_index = len(self.in_features) - _index - 1
171171
out_feat = features[self.in_features[out_index]]
172-
if out_index <= 2:
172+
173+
if isinstance(out_feat, float):
174+
continue
175+
176+
if out_index <= 2 and pred is not None:
173177
out_feat = pred + out_feat
178+
174179
pred = self.layer_decoder_list[out_index](out_feat)
175180
if out_index > 0:
176181
pred = F.interpolate(input=pred,

0 commit comments

Comments
 (0)