Skip to content

Commit 667eeac

Browse files
committed
ensure 0.4 models get float32 inputa
1 parent 67fa607 commit 667eeac

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

bioimageio/core/proc_setup.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,17 @@ def _prepare_procs(
198198
if isinstance(
199199
t_descr,
200200
(v0_4.InputTensorDescr, (v0_4.InputTensorDescr, v0_4.OutputTensorDescr)),
201-
) and not isinstance(procs[-1], EnsureDtype):
201+
):
202+
if len(procs) == 1:
203+
# remove initial ensure_dtype if there are no other proccessing steps
204+
assert isinstance(procs[0], EnsureDtype)
205+
procs = []
206+
207+
# ensure 0.4 models get float32 input
208+
# which has been the implicit assumption for 0.4
202209
member_id = get_member_id(t_descr)
203210
procs.append(
204-
EnsureDtype(input=member_id, output=member_id, dtype=t_descr.data_type)
211+
EnsureDtype(input=member_id, output=member_id, dtype="float32")
205212
)
206213

207214
return procs

0 commit comments

Comments
 (0)