pyhf icon indicating copy to clipboard operation
pyhf copied to clipboard

Fix DeprecationWarning for PyTorch for NumPy 2.0

Open matthewfeickert opened this issue 1 year ago • 0 comments
trafficstars

With NumPy 2.0, PyTorch now has a

DeprecationWarning: In future, it will be an error for 'np.bool' scalars to be interpreted as an index

This started happening on 2024-10-24 when TensorFlow v2.18.0 was released with NumPy 2.0 support and NumPy 2.0 entered the CI system (PyTorch had long had support there). The diff in the packages installed between the previous day and the first failing run is

2024-10-23 2024-10-24
numpy 1.26.4 numpy 2.0.2
protobuf 4.25.5 protobuf 5.28.3
tensorboard 2.17.1 tensorboard 2.18.0
tensorflow 2.17.0 tensorflow 2.18.0
tf_keras 2.17.0 tf_keras 2.18.0
tinycss2 1.3.0 tinycss2 1.4.0
Werkzeug 3.0.4 Werkzeug 3.0.5

We should try to see if we can fix this behavior to avoid the DeprecationWarning. Worse case scenario we add it to the existing filterwarnings.

matthewfeickert avatar Nov 01 '24 08:11 matthewfeickert