Open fhaefele opened 4 months ago
Thanks the hint. I run pip uninstall numpy for the 2.0.x. I run pip install numpy==1.26.4. Now batdetect2 doesn't crash anymore.
Errors while running as below.
Loading model: /home/oliver/anaconda3/envs/batdetect2/lib/python3.10/site-packages/batdetect2/models/Net2DFast_UK_same.pth.tar
Input directory: Expand/ Number of audio files: 2257
Saving results to: batdetect/
Processing Configuration: Time Expansion Factor: 1 Detection Threshold: 0.3
0 Expand/20240726_192212_000.WAV 1 call(s) detected above the threshold. species name probablity present Nyctalus leisleri 0.977 Nyctalus noctula 0.011 Eptesicus serotinus 0.007
1 Expand/20240726_192217_000.WAV 9 call(s) detected above the threshold. species name probablity present Pipistrellus pipistrellus 0.278 Pipistrellus nathusii 0.224 Myotis nattereri 0.133
2 Expand/20240726_192222_000.WAV 3 call(s) detected above the threshold. species name probablity present Pipistrellus pygmaeus 0.56 Pipistrellus pipistrellus 0.431 Pipistrellus nathusii 0.007
3 Expand/20240726_192227_000.WAV 2 call(s) detected above the threshold. species name probablity present Pipistrellus pipistrellus 0.661 Nyctalus leisleri 0.182 Eptesicus serotinus 0.097
4 Expand/20240726_192232_000.WAV Traceback (most recent call last): File "/home/oliver/anaconda3/envs/batdetect2/lib/python3.10/site-packages/batdetect2/utils/detector_utils.py", line 239, in format_single_result class_overall = pp.overall_class_pred( File "/home/oliver/anaconda3/envs/batdetect2/lib/python3.10/site-packages/batdetect2/detector/post_process.py", line 39, in overall_class_pred weighted_pred = (class_prob * det_prob).sum(1) File "/home/oliver/anaconda3/envs/batdetect2/lib/python3.10/site-packages/numpy/_core/_methods.py", line 52, in _sum return umr_sum(a, axis, dtype, out, keepdims, initial, where) numpy.exceptions.AxisError: axis 1 is out of bounds for array of dimension 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/oliver/anaconda3/envs/batdetect2/bin/batdetect2", line 8, in
Am helping a student run Batdetect2, and he gets this exact error:
AttributeError: module 'numpy' has no attribute 'AxisError
when running some, but not all files.
Thanks for the issue! I will be working on fixing bugs this in November and will attend to this in particular.
Thanks for the issue! I will be working on fixing bugs this in November and will attend to this in particular.
Hi @mbsantiago I have an example of a file that does (and one that does not) have this issue collected by the same student if this helps?
That would be very helpful, thanks! Please attach here as a zip file
Attached here, it has a readme explaining each file (as the undergraduate student has told me). Any issues let me know, sorry it is not more reproducible and cleaner!
I just noticed that when I installed your package using
pip install batdetect2
as well as installing it from source (cloning andpip install .
that the latest numpy version results in an error when I try to detect calls.The suggested fix worked nicely. I was able to run batdetect2 after downgrading numpy. Perhaps you should specify
"numpy<2"
in yourpyproject.toml
which will force pip to install a Numpy version 1.x. as it might take time for other dependencies to support Numpy version 2.x