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

Graph visualization unnecessarily wide #864

Open
leosh64 opened this issue Jan 6, 2022 · 10 comments
Open

Graph visualization unnecessarily wide #864

leosh64 opened this issue Jan 6, 2022 · 10 comments

Comments

@leosh64
Copy link

leosh64 commented Jan 6, 2022

For some networks, the visualization of the graph becomes unnecessarily wide. This makes it difficult to understand connections when zoomed in:

image

Throughout the model, there is no section that would justify such a wide visualization.

Below some screenshots when zoomed out:

image

The same issue (unnecessarily high) occurs in horizontal mode:

image

@KarelPeeters
Copy link

I was just about to report this as well!

For example, yolov5n.onnx looks like this for me:

image

This width is somewhat justifiable since the final layers of the model do indeed need the width, but there is no reason for the connections that go from a conv to the following mul to go all the way to the right and back.

@lutzroeder
Copy link
Owner

lutzroeder commented Jan 6, 2022

@leosh64 @KarelPeeters @AlessandroMondin can you investigate this and suggest a fix.

dagrejs/dagre#239 has some context. The paper describing the algorithm can be found here and the code here.

@lutzroeder
Copy link
Owner

yolov5n.onnx.zip

@lutzroeder lutzroeder added the bug label Mar 12, 2022
Repository owner deleted a comment Mar 14, 2022
@AlessandroMondin
Copy link

Hello all, any news on this bug?
I am facing the same issue as weel:
Screenshot 2022-08-31 at 12 56 39

@beru
Copy link

beru commented Apr 14, 2023

It seems the second pass (link) of the horizontalCompaction function is related to this issue.

Tested with yolov5n.onnx.

With the second pass Without the second pass
image image

So my bet is everyone should edit the code to adjust the view when needed.

@seanshpark
Copy link

There was a change to make unnecessary wide edges become narrow.
I assume there are still wide lines, and if so, please share the model to this issue.

@beru
Copy link

beru commented Jun 16, 2024

@seanshpark

I assume there are still wide lines, and if so, please share the model to this issue.

I've just encountered the issue with EfficientDet-d0.onnx file in EfficientDet-d0.onnx.zip so just letting you know it.

The file is listed in test/models.json. link

screenshot

image

@beru
Copy link

beru commented Aug 14, 2024

I still haven't understood the root cause of this problem but applying the change somehow resolved it.

Before:
image

After:
image

@lutzroeder
Copy link
Owner

@beru thank you for investigating. I tried the change on a few files and noticed it changes the symmetry of squeezenet1.1.onnx.

@beru
Copy link

beru commented Aug 17, 2024

@lutzroeder

I tried the change on a few files and noticed it changes the symmetry of squeezenet1.1.onnx.

Thank you for checking it. And... could you also please check this change? link Applying the change yields preferrable result with the EfficientDet-d0.onnx model.

Before:
image

After:
image

I've debugged around horizontalCompaction function for a few days to find out why the problem appears on xss['dl']. With the change, graphs built by buildBlockGraph function contain less edges so it could be that clustering has improved? It's hard (for me) to explain relations of how the change improves layouting results due to lack of understanding.

Edited: This change is more easier to understand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants