Skip to content

Commit a335a70

Browse files
committed
create converted weighs descr with absolute path to avoid a wrong relative path wrt to the given model descr
1 parent 92cdaf6 commit a335a70

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

bioimageio/core/weight_converters/keras_to_tensorflow.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def _convert_tf2(
123123
print("TensorFlow model exported to", output_path)
124124

125125
return TensorflowSavedModelBundleWeightsDescr(
126-
source=output_path,
126+
source=output_path.absolute(),
127127
parent="keras_hdf5",
128128
tensorflow_version=Version(tensorflow.__version__),
129129
comment=f"Converted with bioimageio.core {__version__}.",
@@ -138,7 +138,6 @@ def _convert_tf1(
138138
input_name: str,
139139
output_name: str,
140140
) -> TensorflowSavedModelBundleWeightsDescr:
141-
142141
@no_type_check
143142
def build_tf_model():
144143
keras_model = keras.models.load_model(keras_weight_path)
@@ -167,7 +166,7 @@ def build_tf_model():
167166
print("TensorFlow model exported to", output_path)
168167

169168
return TensorflowSavedModelBundleWeightsDescr(
170-
source=output_path,
169+
source=output_path.absolute(),
171170
parent="keras_hdf5",
172171
tensorflow_version=Version(tensorflow.__version__),
173172
comment=f"Converted with bioimageio.core {__version__}.",

bioimageio/core/weight_converters/pytorch_to_onnx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def convert(
7272
)
7373

7474
return OnnxWeightsDescr(
75-
source=output_path,
75+
source=output_path.absolute(),
7676
parent="pytorch_state_dict",
7777
opset_version=opset_version,
7878
comment=f"Converted with bioimageio.core {__version__}.",

bioimageio/core/weight_converters/pytorch_to_torchscript.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def convert(
6060
scripted_model.save(output_path)
6161

6262
return TorchscriptWeightsDescr(
63-
source=output_path,
63+
source=output_path.absolute(),
6464
pytorch_version=Version(torch.__version__),
6565
parent="pytorch_state_dict",
6666
comment=(

bioimageio/core/weight_converters/torchscript_to_onnx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def convert(
7676
)
7777

7878
return OnnxWeightsDescr(
79-
source=output_path,
79+
source=output_path.absolute(),
8080
parent="torchscript",
8181
opset_version=opset_version,
8282
comment=f"Converted with bioimageio.core {__version__}.",

0 commit comments

Comments
 (0)