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

ASP Automatic Sparsity forward function For Loop Error #1843

Open
maro-jeon opened this issue Sep 6, 2024 · 0 comments
Open

ASP Automatic Sparsity forward function For Loop Error #1843

maro-jeon opened this issue Sep 6, 2024 · 0 comments

Comments

@maro-jeon
Copy link

I am trying to apply the yolov8 model to ASP.
The yolo model has a block called c2f, and the forward function of this block contains a for statement and a list function.

    def forward(self, x):
        """Forward pass through C2f layer."""
        y = list(self.cv1(x).chunk(2, 1))
        y.extend(m(y[-1]) for m in self.m)
        return self.cv2(torch.cat(y, 1))

Because of this, the error below occurs.

I don't know how to avoid this.

If you know, please let me know.

torch.fx.proxy.TraceError: Proxy object cannot be iterated. This can be attempted when the Proxy is used in a loop or as a *args or **kwargs function argument. See the torch.fx docs on pytorch.org for a more detailed explanation of what types of control flow can be traced, and check out the Proxy docstring for help troubleshooting Proxy iteration errors

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