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]: missing dependencies in example max/examples/inference/yolo-python-onnx #261

Open
bmerkle opened this issue Dec 8, 2024 · 2 comments
Assignees
Labels
bug Something isn't working max-repo

Comments

@bmerkle
Copy link

bmerkle commented Dec 8, 2024

Bug description

I ran the example max/examples/inference/yolo-python-onnx.
Running the examples yields two missing dependencies. The output says it would attempting AutoUpdate, but this did not work

YOLOv8n-seg summary (fused): 195 layers, 3404320 parameters, 0 gradients, 12.6 GFLOPs
PyTorch: starting from '../../models/yolo/yolov8n-seg.pt' with input shape (1, 3, 480, 640) BCHW and output shape(s) ((1, 116, 6300), (1, 32, 120, 160)) (6.7 MB)
requirements: Ultralytics requirements ['onnx>=1.12.0', 'onnxsim>=0.4.33'] not found, attempting AutoUpdate...

I had to manually install them

pip install onnx>=1.12.0
pip install onnxsim>=0.4.33

Steps to reproduce

  • Include relevant code snippet or link to code that did not work as expected.
    invoke the bash run.sh script and see the missing dependencies... autofixing does not wor

  • If applicable, add screenshots to help explain the problem.
    Please see error log here

(YOLO Python Onnx) merklbe1@DEAGM13714:~/max/examples/inference/yolo-python-onnx$ bash run.sh
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cpu
....
Requirement already satisfied: six>=1.5 in ./.magic/envs/default/lib/python3.12/site-packages (from python-dateutil>=2.7->matplotlib>=3.3.0->ultralytics==8.2.5->-r requirements.txt (line 7)) (1.17.0)
Downloading Model and Exporting...

Downloading https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov8n-seg.pt to '../../models/yolo/yolov8n-seg.pt'...
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6.74M/6.74M [00:00<00:00, 7.40MB/s]
/home/merklbe1/max/examples/inference/yolo-python-onnx/.magic/envs/default/lib/python3.12/site-packages/ultralytics/nn/tasks.py:732: FutureWarning: You are using `torch.load` with `weights_only=False` (the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for `weights_only` will be flipped to `True`. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via `torch.serialization.add_safe_globals`. We recommend you start setting `weights_only=True` for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
  ckpt = torch.load(file, map_location="cpu")
Ultralytics YOLOv8.2.5 🚀 Python-3.12.8 torch-2.4.0+cpu CPU (12th Gen Intel Core(TM) i7-12800H)
YOLOv8n-seg summary (fused): 195 layers, 3404320 parameters, 0 gradients, 12.6 GFLOPs

PyTorch: starting from '../../models/yolo/yolov8n-seg.pt' with input shape (1, 3, 480, 640) BCHW and output shape(s) ((1, 116, 6300), (1, 32, 120, 160)) (6.7 MB)
requirements: Ultralytics requirements ['onnx>=1.12.0', 'onnxsim>=0.4.33'] not found, attempting AutoUpdate...
^Z
[1]+  Stopped                 bash run.sh
(YOLO Python Onnx) merklbe1@DEAGM13714:~/max/examples/inference/yolo-python-onnx$ pip install onnx>=1.12.0
(YOLO Python Onnx) merklbe1@DEAGM13714:~/max/examples/inference/yolo-python-onnx$ pip install onnxsim>=0.4.33
(

  • Include anything else that might help us debug the issue.
    I manually installed the missing pip libs
(YOLO Python Onnx) merklbe1@DEAGM13714:~/max/examples/inference/yolo-python-onnx$ pip install onnx>=1.12.0
(YOLO Python Onnx) merklbe1@DEAGM13714:~/max/examples/inference/yolo-python-onnx$ pip install onnxsim>=0.4.33

System information

- What OS did you do install MAX on ?
WSL on Windows 10
merklbe1@DEAGM13714:~$ uname -a
Linux DEAGM13714 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
- Provide version information for MAX by pasting the output of max -v`
max                 24.5.0        release

- Provide version information for Mojo by pasting the output of mojo -v`
- Provide Modular CLI version by pasting the output of `modular -v`
magic 0.5.0 - (based on pixi 0.37.0)```
@bmerkle bmerkle added the bug Something isn't working label Dec 8, 2024
@ehsanmok ehsanmok self-assigned this Dec 11, 2024
@ehsanmok
Copy link
Member

Thanks for reporting! Will include the missing ones.

@bmerkle
Copy link
Author

bmerkle commented Dec 11, 2024

I can also create a PR if you like :-)

@goldiegadde goldiegadde added the max-repo label Dec 18, 2024 — with Linear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working max-repo
Projects
None yet
Development

No branches or pull requests

3 participants