Google Collab - ModuleNotFoundError: No module named 'onnx' / OnnxExporterError: Module onnx is not installed!
Opened this issue · 2 comments
endersaka commented
Describe the bug
Google Colab demo fails at Load Configs cell.
To Reproduce
Execute the Google Colab cells.
Expected behavior
I am not sure. To run an example of face reconstruction from a static image?
Screenshots
Instead of a screenshot I copy the cell output.
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting onnxruntime
Downloading onnxruntime-1.14.1-cp39-cp39-manylinux_2_27_x86_64.whl (5.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.0/5.0 MB 39.9 MB/s eta 0:00:00
Requirement already satisfied: numpy>=1.21.6 in /usr/local/lib/python3.9/dist-packages (from onnxruntime) (1.22.4)
Requirement already satisfied: flatbuffers in /usr/local/lib/python3.9/dist-packages (from onnxruntime) (23.3.3)
Requirement already satisfied: protobuf in /usr/local/lib/python3.9/dist-packages (from onnxruntime) (3.20.3)
Requirement already satisfied: sympy in /usr/local/lib/python3.9/dist-packages (from onnxruntime) (1.11.1)
Requirement already satisfied: packaging in /usr/local/lib/python3.9/dist-packages (from onnxruntime) (23.0)
Collecting coloredlogs
Downloading coloredlogs-15.0.1-py2.py3-none-any.whl (46 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.0/46.0 kB 5.1 MB/s eta 0:00:00
Collecting humanfriendly>=9.1
Downloading humanfriendly-10.0-py2.py3-none-any.whl (86 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 86.8/86.8 kB 10.6 MB/s eta 0:00:00
Requirement already satisfied: mpmath>=0.19 in /usr/local/lib/python3.9/dist-packages (from sympy->onnxruntime) (1.3.0)
Installing collected packages: humanfriendly, coloredlogs, onnxruntime
Successfully installed coloredlogs-15.0.1 humanfriendly-10.0 onnxruntime-1.14.1
/usr/local/lib/python3.9/dist-packages/torch/onnx/utils.py:2033: UserWarning: No names were found for specified dynamic axes of provided input.Automatically generated names will be applied to each dynamic axes of input input
warnings.warn(
/usr/local/lib/python3.9/dist-packages/torch/onnx/utils.py:2033: UserWarning: No names were found for specified dynamic axes of provided input.Automatically generated names will be applied to each dynamic axes of input output
warnings.warn(
============= Diagnostic Run torch.onnx.export version 2.0.0+cu118 =============
verbose: False, log level: Level.ERROR
======================= 0 NONE 0 NOTE 0 WARNING 0 ERROR ========================
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
[/usr/local/lib/python3.9/dist-packages/torch/onnx/_internal/onnx_proto_utils.py](https://localhost:8080/#) in _add_onnxscript_fn(model_bytes, custom_opsets)
218 try:
--> 219 import onnx
220 except ImportError as e:
ModuleNotFoundError: No module named 'onnx'
The above exception was the direct cause of the following exception:
OnnxExporterError Traceback (most recent call last)
5 frames
[/usr/local/lib/python3.9/dist-packages/torch/onnx/_internal/onnx_proto_utils.py](https://localhost:8080/#) in _add_onnxscript_fn(model_bytes, custom_opsets)
219 import onnx
220 except ImportError as e:
--> 221 raise errors.OnnxExporterError("Module onnx is not installed!") from e
222
223 # For > 2GB model, onnx.load_fromstring would fail. However, because
OnnxExporterError: Module onnx is not installed!
Platform:
AnaisAtos commented
pip install onnx
worked fine for me :)
endersaka commented
pip install onnx
worked fine for me :)
Sorry, it's been a while since I tried to run this source and, at the moment, I can't recall exactly all the things. I guess you mean running it in the beginning.