DrAlexLiu / OctoPrint-PiNozCam

AI model running on RPi for failure detection
GNU Affero General Public License v3.0
41 stars 4 forks source link

assumes octopi 1.0.0 #8

Closed jneilliii closed 8 months ago

jneilliii commented 8 months ago

This line appears to assume bullseye image, but there are also still stretch and bookworm releases out in the wild.

https://github.com/DrAlexLiu/OctoPrint-PiNozCam/blob/1c9519ced05f8e41434b57615cf8a81be97dcff3/setup.py#L40C5-L40C159

ERROR: onnxruntime-1.15.0-cp39-cp39-linux_armv7l.whl is not a supported wheel on this platform.

DrAlexLiu commented 8 months ago

Would you tell me how to download Octoprint's stretch and bookworm releases?

DrAlexLiu commented 8 months ago

If you use stretch,

would you try to run

pip install https://github.com/nknytk/built-onnxruntime-for-raspberrypi-linux/blob/master/wheels/stretch/onnxruntime-1.3.0-cp38-cp38-linux_armv7l.whl

if you use bookworm,

I believe as long as it is x64 system,

pip install onnxruntime would solve everything.

If it is x32 system,

You should find the onnxruntime on your platfrom here:

https://github.com/nknytk/built-onnxruntime-for-raspberrypi-linux/tree/master/wheels

and use pip install for those.

jneilliii commented 8 months ago

I'm not actually using the plugin, just trying to report issues we've seen in the community. But to get bookwork version you could grab that here a buster version can be downloaded here. Not sure if a stretch version would warrant accounting for since that one didn't have python 3.

jneilliii commented 8 months ago

something like this may work to figure out which wheel to install.

import os
import re

try:
    with open('/etc/os-release', 'r') as file:
        # Read the content of the file
        content = file.read()
except FileNotFoundError:
    content = "unknown"

regex = re.compile(r"PRETTY_NAME=.*\((.*)\)")
test = regex.match(content)
if test:
    friendly_name = test.groups()[0]
    if friendly_name == "bullseye":
        plugin_requires.append("onnxruntime @ https://github.com/nknytk/built-onnxruntime-for-raspberrypi-linux/raw/master/wheels/bullseye/onnxruntime-1.15.0-cp39-cp39-linux_armv7l.whl")
    elif friendly_name == "buster":
        plugin_requires.append("onnxruntime @ <url to correct wheel>")
    elif friendly_name == "bookworm":
        plugin_requires.append("onnxruntime @ <url to correct wheel>")
DrAlexLiu commented 8 months ago

I double check the problem. For stretch, the x32 platform is too old, the onnxruntime in that time would not support my AI model. For bookworm, there is no onnxruntime package for x32. If everyone wants to use it on bookworm, please install the x64 platform. It is working on x64 platform without any issue.

jneilliii commented 8 months ago

that makes sense, but you may want to document that on the readme. the most common octopi installs out there right now are bullseye and buster, so just handling those two for now would probably reduce some of the support overhead.