Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug when attr value not jsonable #1260

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions visualdl/component/graph/graph_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def analyse_model(model_pb): # noqa: C901
all_vars[var_name]['persistable'] = var_desc.persistable()
attr_dict = {}
for attr_name in var_desc.attr_names():
attr_dict[attr_name] = var_desc.attr(attr_name)
attr_dict[attr_name] = str(var_desc.attr(attr_name))
all_vars[var_name]['attrs'] = attr_dict
all_vars[var_name]['from_node'] = ''
all_vars[var_name]['to_nodes'] = []
Expand All @@ -227,7 +227,7 @@ def analyse_model(model_pb): # noqa: C901
all_vars[var_name]['persistable'] = var_desc.persistable()
attr_dict = {}
for attr_name in var_desc.attr_names():
attr_dict[attr_name] = var_desc.attr(attr_name)
attr_dict[attr_name] = str(var_desc.attr(attr_name))
all_vars[var_name]['attrs'] = attr_dict
all_vars[var_name]['from_node'] = ''
all_vars[var_name]['to_nodes'] = []
Expand Down Expand Up @@ -268,7 +268,7 @@ def analyse_model(model_pb): # noqa: C901
try:
if attr_name == 'sub_block':
continue
attr_dict[attr_name] = op_desc.attr(attr_name)
attr_dict[attr_name] = str(op_desc.attr(attr_name))
attr_type = op_desc.attr_type(attr_name)
attr_type_dict[attr_name] = attr_type_name[
attr_type] if attr_type in attr_type_name else str(
Expand Down