Skip to content

Commit 2538c9d

Browse files
ppwwyyxxfacebook-github-bot
authored andcommitted
check for errors in SemSegFPNHead
Summary: close facebookresearch#3316 Reviewed By: wat3rBro Differential Revision: D30062593 fbshipit-source-id: e8b614c21f62012e081f425dd9df850179f1f2a7
1 parent dbe2c9c commit 2538c9d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

detectron2/modeling/meta_arch/semantic_seg.py

+2
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ def __init__(
163163
"""
164164
super().__init__()
165165
input_shape = sorted(input_shape.items(), key=lambda x: x[1].stride)
166+
if not len(input_shape):
167+
raise ValueError("SemSegFPNHead(input_shape=) cannot be empty!")
166168
self.in_features = [k for k, v in input_shape]
167169
feature_strides = [v.stride for k, v in input_shape]
168170
feature_channels = [v.channels for k, v in input_shape]

0 commit comments

Comments
 (0)