ultralytics / ultralytics

NEW - YOLOv8 🚀 in PyTorch > ONNX > OpenVINO > CoreML > TFLite
https://docs.ultralytics.com
GNU Affero General Public License v3.0
28.35k stars 5.64k forks source link

new yolo install errors out, both CLI and Python #15001

Open gschlossnagle opened 1 month ago

gschlossnagle commented 1 month ago

Search before asking

Ultralytics YOLO Component

Predict

Bug

Fresh install of ultralytics via pip on MacOS.

Running sample detect on the cli returns the following error

% yolo detect predict model=yolov8n.pt source='https://ultralytics.com/images/bus.jpg'
Ultralytics YOLOv8.2.74 🚀 Python-3.12.2 torch-2.4.0 CPU (Apple M2 Max) Traceback (most recent call last): File "/Users/george/miniconda3/bin//yolo", line 8, in sys.exit(entrypoint()) ^^^^^^^^^^^^ File "/Users/george/miniconda3/lib/python3.12/site-packages/ultralytics/cfg/init.py", line 834, in entrypoint getattr(model, mode)(*overrides) # default args from model ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/george/miniconda3/lib/python3.12/site-packages/ultralytics/engine/model.py", line 556, in predict self.predictor.setup_model(model=self.model, verbose=is_cli) File "/Users/george/miniconda3/lib/python3.12/site-packages/ultralytics/engine/predictor.py", line 303, in setup_model self.model = AutoBackend( ^^^^^^^^^^^^ File "/Users/george/miniconda3/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context return func(args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/Users/george/miniconda3/lib/python3.12/site-packages/ultralytics/nn/autobackend.py", line 124, in init ) = self._model_type(w) ^^^^^^^^^^^^^^^^^^^ File "/Users/george/miniconda3/lib/python3.12/site-packages/ultralytics/nn/autobackend.py", line 656, in _model_type sf = list(export_formats().Suffix) # export suffixes ^^^^^^^^^^^^^^^^ File "/Users/george/miniconda3/lib/python3.12/site-packages/ultralytics/engine/exporter.py", line 116, in export_formats return pandas.DataFrame(x, columns=["Format", "Argument", "Suffix", "CPU", "GPU"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/george/miniconda3/lib/python3.12/site-packages/pandas/core/frame.py", line 850, in init columns = ensure_index(columns) ^^^^^^^^^^^^^^^^^^^^^ File "/Users/george/miniconda3/lib/python3.12/site-packages/pandas/core/indexes/base.py", line 7647, in ensure_index return Index(index_like, copy=copy, tupleize_cols=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/george/miniconda3/lib/python3.12/site-packages/pandas/core/indexes/base.py", line 565, in new arr = sanitize_array(data, None, dtype=dtype, copy=copy) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/george/miniconda3/lib/python3.12/site-packages/pandas/core/construction.py", line 654, in sanitize_array subarr = maybe_convert_platform(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/george/miniconda3/lib/python3.12/site-packages/pandas/core/dtypes/cast.py", line 139, in maybe_convert_platform arr = lib.maybe_convert_objects(arr) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "lib.pyx", line 2538, in pandas._libs.lib.maybe_convert_objects TypeError: Cannot convert numpy.ndarray to numpy.ndarray

I get the same backtrace when using python as well:

from ultralytics import YOLO
model = YOLO("yolov8m.pt")
results = model.predict("/Users/george/PycharmProjects/sharpnessDetection/samples/cat_dog.jpg")

/Users/george/miniconda3/bin/python /Users/george/PycharmProjects/sharpnessDetection/test.py Traceback (most recent call last): File "/Users/george/PycharmProjects/sharpnessDetection/test.py", line 20, in results = model.predict("/Users/george/PycharmProjects/sharpnessDetection/samples/cat_dog.jpg") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/george/miniconda3/lib/python3.12/site-packages/ultralytics/engine/model.py", line 556, in predict self.predictor.setup_model(model=self.model, verbose=is_cli) File "/Users/george/miniconda3/lib/python3.12/site-packages/ultralytics/engine/predictor.py", line 303, in setup_model self.model = AutoBackend( ^^^^^^^^^^^^ File "/Users/george/miniconda3/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/Users/george/miniconda3/lib/python3.12/site-packages/ultralytics/nn/autobackend.py", line 124, in init ) = self._model_type(w) ^^^^^^^^^^^^^^^^^^^ File "/Users/george/miniconda3/lib/python3.12/site-packages/ultralytics/nn/autobackend.py", line 656, in _model_type sf = list(export_formats().Suffix) # export suffixes ^^^^^^^^^^^^^^^^ File "/Users/george/miniconda3/lib/python3.12/site-packages/ultralytics/engine/exporter.py", line 116, in export_formats return pandas.DataFrame(x, columns=["Format", "Argument", "Suffix", "CPU", "GPU"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/george/miniconda3/lib/python3.12/site-packages/pandas/core/frame.py", line 850, in init columns = ensure_index(columns) ^^^^^^^^^^^^^^^^^^^^^ File "/Users/george/miniconda3/lib/python3.12/site-packages/pandas/core/indexes/base.py", line 7647, in ensure_index return Index(index_like, copy=copy, tupleize_cols=False) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/george/miniconda3/lib/python3.12/site-packages/pandas/core/indexes/base.py", line 565, in new arr = sanitize_array(data, None, dtype=dtype, copy=copy) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/george/miniconda3/lib/python3.12/site-packages/pandas/core/construction.py", line 654, in sanitize_array subarr = maybe_convert_platform(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/george/miniconda3/lib/python3.12/site-packages/pandas/core/dtypes/cast.py", line 139, in maybe_convert_platform arr = lib.maybe_convert_objects(arr) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "lib.pyx", line 2538, in pandas._libs.lib.maybe_convert_objects TypeError: Cannot convert numpy.ndarray to numpy.ndarray

Process finished with exit code 1

Environment


Ultralytics YOLOv8.2.74 🚀 Python-3.12.2 torch-2.4.0 CPU (Apple M2 Max)
Setup complete ✅ (12 CPUs, 32.0 GB RAM, 3110.6/3721.9 GB disk)

OS                  macOS-14.5-arm64-arm-64bit
Environment         Darwin
Python              3.12.2
Install             pip
RAM                 32.00 GB
CPU                 Apple M2 Max
CUDA                None

numpy               ✅ 1.26.4<2.0.0,>=1.23.0
matplotlib          ✅ 3.9.0>=3.3.0
opencv-python       ✅ 4.10.0>=4.6.0
pillow              ✅ 10.4.0>=7.1.2
pyyaml              ✅ 6.0.1>=5.3.1
requests            ✅ 2.31.0>=2.23.0
scipy               ✅ 1.14.0>=1.4.1
torch               ✅ 2.4.0>=1.8.0
torchvision         ✅ 0.19.0>=0.9.0
tqdm                ✅ 4.65.0>=4.64.0
psutil              ✅ 6.0.0
py-cpuinfo          ✅ 9.0.0
pandas              ✅ 2.2.2>=1.1.4
seaborn             ✅ 0.13.2>=0.11.0
ultralytics-thop    ✅ 2.0.0>=2.0.0
george@Georges-MBP sharpnessDetection % ```

### Minimal Reproducible Example

`yolo detect predict model=yolov8n.pt source='https://ultralytics.com/images/bus.jpg'`

### Additional

_No response_

### Are you willing to submit a PR?

- [ ] Yes I'd like to help by submitting a PR!
github-actions[bot] commented 1 month ago

👋 Hello @gschlossnagle, thank you for your interest in Ultralytics YOLOv8 🚀! We recommend a visit to the Docs for new users where you can find many Python and CLI usage examples and where many of the most common questions may already be answered.

If this is a 🐛 Bug Report, please provide a minimum reproducible example to help us debug it.

If this is a custom training ❓ Question, please provide as much information as possible, including dataset image examples and training logs, and verify you are following our Tips for Best Training Results.

Join the vibrant Ultralytics Discord 🎧 community for real-time conversations and collaborations. This platform offers a perfect space to inquire, showcase your work, and connect with fellow Ultralytics users.

Install

Pip install the ultralytics package including all requirements in a Python>=3.8 environment with PyTorch>=1.8.

pip install ultralytics

Environments

YOLOv8 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):

Status

Ultralytics CI

If this badge is green, all Ultralytics CI tests are currently passing. CI tests verify correct operation of all YOLOv8 Modes and Tasks on macOS, Windows, and Ubuntu every 24 hours and on every commit.

Y-T-G commented 1 month ago

https://stackoverflow.com/a/78756422