BYU-PRISM / GEKKO

GEKKO Python for Machine Learning and Dynamic Optimization
https://machinelearning.byu.edu
Other
569 stars 102 forks source link

Usage on aarch64 Rasperry Pi #139

Closed Tim1605 closed 5 months ago

Tim1605 commented 2 years ago

Hello, I would like to use gekko locally on a rasperry pi aarch64. But unfortunately I get the following error message: Exception Type: OSError Exception Value:
[Errno 8] Exec format error: '/home/pi/.local/lib/python3.9/site-packages/gekko/bin/apm'

I guess the error is in the gekko.py in line 2089, because there is only searched for the arm architecture for a rasperry pi. I tried to solve the problem by adding the line to: if os.uname()[4].startswith("arm") or os.uname()[4].startswith("aar"): changed. However, this causes the following error message to appear: FileNotFoundError: [Errno 2] No such file or directory: '/home/pi/.local/lib/python3.9/site-packages/gekko/bin/apm_arm'

Would it be possible to enable the local solution on an aarch64?

Thanks a lot

APMonitor commented 2 years ago

It looks like the error is that it can't find the apm_arm executable. Could you verify that it is located at /home/pi/.local/lib/python3.9/site-packages/gekko/bin/apm_arm We may need to update the directory location. The executable should work on the arm architecture for the raspberry pi.

Tim1605 commented 2 years ago

The path /home/pi/.local/lib/python3.9/site-packages/gekko/bin/ contains the following files:

image

APMonitor commented 2 years ago

It looks like the executable is there and it is the correct path. Are there any other errors besides the one that you reported?

FileNotFoundError: [Errno 2] No such file or directory: '/home/pi/.local/lib/python3.9/site-packages/gekko/bin/apm_arm'
Tim1605 commented 2 years ago

No, after adding the line there is only this error

APMonitor commented 2 years ago

What is the Raspberry Pi version that you are using?

Tim1605 commented 2 years ago

I'm using a Raspberry Pi 3B+

Tim1605 commented 2 years ago

Hello, is there a solution in sight?

APMonitor commented 2 years ago

It looks like the binary for apm_arm may be compatible with the device as shown at https://unix.stackexchange.com/questions/461179/what-is-the-difference-between-different-implemetation-of-arm64-aarch64-for-linu I don't have a Raspberry Pi 3+ for testing currently but I'll let you know as soon as there are some developments.

APMonitor commented 2 years ago

A new version of the apm_arm file is released with gekko v1.0.4. Could you test it and see if it works for you? It is a 32-bit executable, compiled on a Raspberry Pi for compatibility for Raspberry Pi 2, 3, and 4.

APMonitor commented 5 months ago

A new aarch64 binary is currently available on GitHub and will be included with gekko v1.0.7 soon.