installing PytorchWildlife on fresh python environment results in errors.
Discussed in https://github.com/microsoft/CameraTraps/discussions/563
Originally posted by jennzhugewps January 31, 2025 Hi PytorchWildlife team! Thank you for the awesome update, we will be using the new Amazon model in production soon :) When I upgraded an existing install of PytorchWildlife in an environment with many existing installations like ultralytics and yolo, I had no issues. However, when I try to install the package on a fresh python environment with nothing on it, I get this import error after a successful install:
import PytorchWildlife Traceback (most recent call last): File "
", line 1, in File "/mnt/c/Users/jennz/Documents/GitHub/akili.clearml.tasks/venv/lib/python3.12/site-packages/PytorchWildlife/init.py", line 9, in from .models import * File "/mnt/c/Users/jennz/Documents/GitHub/akili.clearml.tasks/venv/lib/python3.12/site-packages/PytorchWildlife/models/init.py", line 2, in from .detection import * File "/mnt/c/Users/jennz/Documents/GitHub/akili.clearml.tasks/venv/lib/python3.12/site-packages/PytorchWildlife/models/detection/init.py", line 1, in from .ultralytics_based import * File "/mnt/c/Users/jennz/Documents/GitHub/akili.clearml.tasks/venv/lib/python3.12/site-packages/PytorchWildlife/models/detection/ultralytics_based/init.py", line 1, in from .yolov5_base import * File "/mnt/c/Users/jennz/Documents/GitHub/akili.clearml.tasks/venv/lib/python3.12/site-packages/PytorchWildlife/models/detection/ultralytics_based/yolov5_base.py", line 17, in from yolov5.utils.general import non_max_suppression, scale_coords File "/mnt/c/Users/jennz/Documents/GitHub/akili.clearml.tasks/venv/lib/python3.12/site-packages/yolov5/init.py", line 2, in import yolov5.export as export File "/mnt/c/Users/jennz/Documents/GitHub/akili.clearml.tasks/venv/lib/python3.12/site-packages/yolov5/export.py", line 62, in from yolov5.models.yolo import Detect File "/mnt/c/Users/jennz/Documents/GitHub/akili.clearml.tasks/venv/lib/python3.12/site-packages/yolov5/models/yolo.py", line 25, in from utils.autoanchor import check_anchor_order ModuleNotFoundError: No module named 'utils.autoanchor'
I am using Windows Subsystem for Linux with a python 3.12 venv.
I asked my friend to try installing PytorchWildlife on a fresh python 3.10 venv on his Mac and he got this error after importing:
import PytorchWildlife
A module that was compiled using NumPy 1.x cannot be run in NumPy 2.1.1 as it may crash. To support both 1.x and 2.x versions of NumPy, modules must be compiled with NumPy 2.0. Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.
If you are a user of the module, the easiest solution will be to downgrade to 'numpy<2' or try to upgrade the affected module. We expect that some modules will need time to support NumPy 2.
Traceback (most recent call last): File "
File "/Users/velizarshulev/Projects/ClaimCompass/test/env/lib/python3.10/site-packages/torch/nn/modules/transformer.py", line 20, in
Could you provide some insight on what is happening? Thanks!
Hi @jennzhugewps, thanks for reporting. We have attempted to replicate the issues by creating fresh environments with the specified python versions, but PytorchWildlife imports without any issues in our end. However, we suggest trying the following command to ensure you're using a compatible version of YOLOv5:
pip install yolov5==6.2
If this does not resolve the issue, could you please provide us with a detailed step-by-step process of your installation? This will help us to replicate the scenario more accurately and assist you better. Thank you!