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

import ik error #28

Open
lafnac opened this issue Feb 21, 2024 · 2 comments
Open

import ik error #28

lafnac opened this issue Feb 21, 2024 · 2 comments
Assignees
Labels
installation Installation issue

Comments

@lafnac
Copy link

lafnac commented Feb 21, 2024

hi

i successfully installed ikomia using pip in a virtual env (pycharm + python 3.9). i tried to run the above code and i get many errors. First the line "from ikomia.utils import ik" prodce the following error "Cannot find reference 'ik' in 'init.py'. Other errors are listed bellow the code

from ikomia.dataprocess.workflow import Workflow
from ikomia.utils import ik

wf = Workflow()

resnet = wf.add_task(ik.train_torchvision_resnet(
model_name="resnet34",
batch_size="16",
epochs="5"
),
auto_connect=True
)

dataset_folder = "/home/train/"

wf.run_on(folder=dataset_folder)

/home/resnet/resnet-ikomia.py
Traceback (most recent call last):
File "/home/shared-env/lib/python3.9/site-packages/ikomia/core/init.py", line 19, in
from ikomia.core.pycore import *
ImportError: libusb-1.0.so.0: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/resnet/resnet-ikomia.py", line 1, in
from ikomia.dataprocess.workflow import Workflow
File "/home/shared-env/lib/python3.9/site-packages/ikomia/init.py", line 17, in
from ikomia import utils
File "/home/shared-env/lib/python3.9/site-packages/ikomia/utils/init.py", line 15, in
from ikomia.utils import iklogger
File "/home/shared-env/lib/python3.9/site-packages/ikomia/utils/iklogger.py", line 25, in
from ikomia.core import config
File "/home/shared-env/lib/python3.9/site-packages/ikomia/core/init.py", line 22, in
from ikomia.lib.pycore import *
ModuleNotFoundError: No module named 'ikomia.lib.pycore'

Process finished with exit code 1

================================================================================================

same errors with this code too

from ikomia.dataprocess.workflow import Workflow
from ikomia.utils.displayIO import display

wf = Workflow()

canny = wf.add_task(name="ocv_canny", auto_connect=True)

wf.run_on(url="https://raw.githubusercontent.com/Ikomia-dev/notebooks/main/examples/img/img_work.jpg")

display(canny.get_input(0).get_image())
display(canny.get_output(0).get_image())

Environment:

  • Debian 11
  • Python version 3.9
  • Ikomia API version 0.10.0

any suggestion please?
many thanks.

@LudoBar
Copy link
Contributor

LudoBar commented Feb 26, 2024

Hi @lafnac,

It seems that libusb-1.0.so is missing from your OS. This library is required because it's a dependency inherited from OpenCV. We try to include as many dependencies as possible, but some may be missing on some Linux distributions.

So as a first step to your issue, install the libusb-1.0:
sudo apt-get install libusb-1.0-0-dev

As it could be the root cause, let me know if you still have errors then.

@netpoe
Copy link

netpoe commented Jul 21, 2024

Hi @lafnac,

It seems that libusb-1.0.so is missing from your OS. This library is required because it's a dependency inherited from OpenCV. We try to include as many dependencies as possible, but some may be missing on some Linux distributions.

So as a first step to your issue, install the libusb-1.0: sudo apt-get install libusb-1.0-0-dev

As it could be the root cause, let me know if you still have errors then.

On my end, Ubuntu 20+, Python 3.10, I needed to install several more libraries to run this code:

from ikomia.dataprocess.workflow import Workflow
from ikomia.utils.displayIO import display

# Init your workflow
wf = Workflow()

# Add the Canny Edge Detector
canny = wf.add_task(name="ocv_canny", auto_connect=True)

# Run on your image
# wf.run_on(path="path/to/your/image.png")
wf.run_on(
    url="https://raw.githubusercontent.com/Ikomia-dev/notebooks/main/examples/img/img_work.jpg"
)

# Inspect your results
display(canny.get_input(0).get_image())
display(canny.get_output(0).get_image())

These libraries were needed:

apt install libsm6
apt install libthai0
apt install libegl1-mesa-dev
apt install libharfbuzz0b
apt install libglu1-mesa-dev

Then the example ran successfully.

@LudoBar LudoBar added the installation Installation issue label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installation Installation issue
Projects
None yet
Development

No branches or pull requests

3 participants