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

Numpy 2.0.0 causes runtime errors #88

Open
Enzo-Kerkhof opened this issue Jul 8, 2024 · 0 comments
Open

Numpy 2.0.0 causes runtime errors #88

Enzo-Kerkhof opened this issue Jul 8, 2024 · 0 comments

Comments

@Enzo-Kerkhof
Copy link

On windows 10 with a conda env Python 3.10.14

Package                  Version
------------------------ ---------
colorama                 0.4.6
keyboard                 0.13.5
ndicapi                  3.7.2
numpy                    2.0.0
opencv-python            4.10.0.84
pip                      24.0
pyserial                 3.5
scikit-surgerycore       0.7.2
scikit-surgerynditracker 1.0.1
setuptools               69.5.1
six                      1.16.0
tqdm                     4.66.4
wheel                    0.43.0

Starting tracking causes this runtime error:

Traceback (most recent call last):
  File "C:\Users\e.kerkhof\.conda\envs\test_ndi\lib\site-packages\sksurgerycore\baseclasses\tracker.py", line 116, in add_frame_to_buffer
    my_index = self.port_handles.index(port_handle)
ValueError: 10 is not in list

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\Users\e.kerkhof\Local_Code\em-camera-checkerboard-calibration\run.py", line 134, in <module>
    tracking_frame = tracker.get_frame()
  File "C:\Users\e.kerkhof\.conda\envs\test_ndi\lib\site-packages\sksurgerynditracker\nditracker.py", line 490, in get_frame
    self.add_frame_to_buffer(port_handles, time_stamps, frame_numbers,
  File "C:\Users\e.kerkhof\.conda\envs\test_ndi\lib\site-packages\sksurgerycore\baseclasses\tracker.py", line 120, in add_frame_to_buffer
    self.time_stamps.append(RollingMean(1, self.buffer_size,
  File "C:\Users\e.kerkhof\.conda\envs\test_ndi\lib\site-packages\sksurgerycore\algorithms\tracking_smoothing.py", line 83, in __init__
    self._buffer[:] = np.NaN
  File "C:\Users\e.kerkhof\.conda\envs\test_ndi\lib\site-packages\numpy\__init__.py", line 411, in __getattr__
    raise AttributeError(
AttributeError: `np.NaN` was removed in the NumPy 2.0 release. Use `np.nan` instead.. Did you mean: 'nan'?

My assumtion is that in order for this to work again track_smoothing.py needs to be updated. Will create pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant