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

object_detection recipe does not start in AI Lab #220

Closed
Tracked by #869
jeffmaury opened this issue Apr 10, 2024 · 3 comments · Fixed by #256
Closed
Tracked by #869

object_detection recipe does not start in AI Lab #220

jeffmaury opened this issue Apr 10, 2024 · 3 comments · Fixed by #256

Comments

@jeffmaury
Copy link
Collaborator

The object_detection_server starts with the following error:

Traceback (most recent call last):
  File "/opt/app-root/bin/uvicorn", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/app-root/lib64/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/app-root/lib64/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/app-root/lib64/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/app-root/lib64/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/app-root/lib64/python3.11/site-packages/uvicorn/main.py", line 409, in main
    run(
  File "/opt/app-root/lib64/python3.11/site-packages/uvicorn/main.py", line 575, in run
    server.run()
  File "/opt/app-root/lib64/python3.11/site-packages/uvicorn/server.py", line 65, in run
    return asyncio.run(self.serve(sockets=sockets))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/opt/app-root/lib64/python3.11/site-packages/uvicorn/server.py", line 69, in serve
    await self._serve(sockets)
  File "/opt/app-root/lib64/python3.11/site-packages/uvicorn/server.py", line 76, in _serve
    config.load()
  File "/opt/app-root/lib64/python3.11/site-packages/uvicorn/config.py", line 433, in load
    self.loaded_app = import_from_string(self.app)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/app-root/lib64/python3.11/site-packages/uvicorn/importer.py", line 19, in import_from_string
    module = importlib.import_module(module_str)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/locallm/object_detection_server.py", line 15, in <module>
    processor = AutoImageProcessor.from_pretrained(model, revision=revision)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
�  File "/opt/app-root/lib64/python3.11/site-packages/transformers/models/auto/image_processing_auto.py", line 358, in from_pretrained
    config_dict, _ = ImageProcessingMixin.get_image_processor_dict(pretrained_model_name_or_path, **kwargs)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
�  File "/opt/app-root/lib64/python3.11/site-packages/transformers/image_processing_utils.py", line 363, in get_image_processor_dict
    text = reader.read()
           ^^^^^^^^^^^^^
  File "<frozen codecs>", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 64: invalid start byte

@MichaelClifford
Copy link
Collaborator

I cannot reproduce this error. Can you provide more details?

@jeffmaury
Copy link
Collaborator Author

I cannot reproduce this error. Can you provide more details?

Here is my recording of this issue:

2024-04-11.11-02-41.mp4

@jeffmaury
Copy link
Collaborator Author

I think I understand the issue. AI Lab downloads the model locally as a single file (pytorch-model.bin) and launches the container with MODEL_PATH being that file. But I think you are expecting a folder with all files from HuggingFace rather that a single file

@jeffmaury jeffmaury changed the title object_detection recipe does not start in Ai Lab object_detection recipe does not start in AI Lab Apr 11, 2024
jeffmaury added a commit to jeffmaury/ai-lab-recipes that referenced this issue Apr 12, 2024
Fixes containers#220

Signed-off-by: Jeff MAURY <jmaury@redhat.com>
jeffmaury added a commit to jeffmaury/ai-lab-recipes that referenced this issue Apr 16, 2024
Fixes containers#220

Signed-off-by: Jeff MAURY <jmaury@redhat.com>
Gregory-Pereira added a commit that referenced this issue Apr 16, 2024
fix: update object_detection recipe for be compatible with AI Lab
MichaelClifford pushed a commit to MichaelClifford/locallm that referenced this issue Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

2 participants