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

KeyError: 'P' Error happens #24

Open
LimHyungTae opened this issue Dec 12, 2024 · 0 comments
Open

KeyError: 'P' Error happens #24

LimHyungTae opened this issue Dec 12, 2024 · 0 comments

Comments

@LimHyungTae
Copy link
Member

I tried to visualize dsg.json file, but once I run notebooks/bindings_demo.py, the below error occurs:

Traceback (most recent call last):
  File "bindings_demo.py", line 68, in <module>
    fig = dsg.plot_scene_graph(G, layer_settings=layer_settings)
  File "/home/shapelim/dcist_ws/src/DCIST-Spark-Core/spark_dsg/python/src/spark_dsg/visualization.py", line 108, in plot_scene_graph
    _draw_layer_nodes(fig, layer, **settings)
  File "/home/shapelim/dcist_ws/src/DCIST-Spark-Core/spark_dsg/python/src/spark_dsg/visualization.py", line 67, in _draw_layer_nodes
    pos.append(np.squeeze(z_offset(node)))
  File "/home/shapelim/dcist_ws/src/DCIST-Spark-Core/spark_dsg/python/src/spark_dsg/visualization.py", line 49, in z_offset
    offset[2] += NODE_TYPE_OFFSET[node.id.category]
KeyError: 'P'

So, I circumvent this issue like that:

if node.id.category == "P":
      offset[2] += NODE_TYPE_OFFSET["p"]
  else :
      offset[2] += NODE_TYPE_OFFSET[node.id.category]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant