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

Bug: NameError: name 'exit' is not defined #259

Open
ambitious-octopus opened this issue Jan 15, 2025 · 0 comments
Open

Bug: NameError: name 'exit' is not defined #259

ambitious-octopus opened this issue Jan 15, 2025 · 0 comments

Comments

@ambitious-octopus
Copy link

There is currently a bug in Google Colab and IPython that prevents the library from being imported. This is a critical issue for many users, as it effectively blocks usage of the library. The problem has already been reported in the following issues: #44, #160.

Error Details

The error occurs during the initialization of rknn.api.rknn_base and rknn.api.graph_optimizer, resulting in the following traceback:

File rknn/api/rknn_base.py:24, in init rknn.api.rknn_base()
File rknn/api/graph_optimizer.py:1, in init rknn.api.graph_optimizer()
NameError: name 'exit' is not defined

Steps to Reproduce

To replicate the issue:

  1. In IPython:

    pip install ipython
    ipython -c 'from rknn.api import RKNN'
  2. In Google Colab:

    from rknn.api import RKNN

Temporary Workaround

A temporary and admittedly hacky workaround is to redefine the exit function before importing the library:

import builtins
builtins.exit = lambda: None
from rknn.api import RKNN

Limitations

Unfortunately, this workaround is neither clean nor robust. Since the source code of the library is unavailable, submitting a proper pull request to resolve the issue is not possible. This bug significantly impacts users, making the library difficult to integrate effectively.

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