Skip to content

Commit

Permalink
Fix tb receiver
Browse files Browse the repository at this point in the history
  • Loading branch information
YuanTingHsieh authored and IsaacYangSLA committed Feb 2, 2024
1 parent dfa7c0f commit 2a8e805
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
6 changes: 1 addition & 5 deletions nvflare/apis/analytix.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,7 @@ def convert_data_type(
return sender_data_type

if sender == LogWriterName.MLFLOW and receiver == LogWriterName.TORCH_TB:
if AnalyticsDataType.PARAMETER == sender_data_type:
return AnalyticsDataType.SCALAR
elif AnalyticsDataType.PARAMETERS == sender_data_type:
return AnalyticsDataType.SCALARS
elif AnalyticsDataType.METRIC == sender_data_type:
if AnalyticsDataType.METRIC == sender_data_type:
return AnalyticsDataType.SCALAR
elif AnalyticsDataType.METRICS == sender_data_type:
return AnalyticsDataType.SCALARS
Expand Down
4 changes: 1 addition & 3 deletions nvflare/app_opt/tracking/tb/tb_receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
AnalyticsDataType.TEXT: "add_text",
AnalyticsDataType.IMAGE: "add_image",
AnalyticsDataType.SCALARS: "add_scalars",
AnalyticsDataType.PARAMETER: "add_scalar",
AnalyticsDataType.PARAMETERS: "add_scalars",
AnalyticsDataType.METRIC: "add_scalar",
AnalyticsDataType.METRICS: "add_scalars",
}
Expand Down Expand Up @@ -91,7 +89,7 @@ def save(self, fl_ctx: FLContext, shareable: Shareable, record_origin):
)
func_name = FUNCTION_MAPPING.get(analytic_data.data_type, None)
if func_name is None:
self.log_error(fl_ctx, f"The data_type {analytic_data.data_type} is not supported.", fire_event=False)
self.log_warning(fl_ctx, f"The data_type {analytic_data.data_type} is not supported.", fire_event=False)
return

func = getattr(writer, func_name)
Expand Down

0 comments on commit 2a8e805

Please sign in to comment.