-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
AttributeError: module 'onnx' has no attribute 'load' #28835
Comments
Just add some context (i.e., not exactly the answer to the question) - to the best of my knowledge, |
This error here is caused by the module 'onnx'(before pip install onnx) which can avoid python import inspection, I try to recur this situation but still got nothing. @ezyang would you like provide info about this situation? that would be very helpful. IMO, wrap this case "test_strip_doc_string" in some context which scenario should run(Ex. method |
This issue is pretty old so I'm happy to just assume it's been silently fixed since then. |
I am still getting the same error with onnx.load. Is it resolved?? If yes, could someone pls point me in the right direction |
I had the same problem fixed it in a way that, I had my python file name "onnx.py" same name as the library I was importing, changing the name of my python file from "onnx.py" to "converting_to_onnx.py" solved the issue. |
for those curious on why this happens is because when you run a py file named "onnx.py" it first adds that directory to your python search path. It then searches for a name to import ( |
I jumped into this trap too...😂 |
When I run
test/onnx/test_utility_funs.py
locally I get an error:I can fix it by running
pip install onnx
. But the error message here is unexpected; if onnx wasn't installed, why did I get an error that it imported successfully and just doesn't have any attributes?When I print
onnx.__file__
I getNone
. My best guess is that we are accidentally picking uptest/onnx
folder as a namespace.cc @houseroad @spandantiwari @lara-hdr @BowenBao @neginraoof
The text was updated successfully, but these errors were encountered: