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

Pin numpy less than 2.0 #4

Merged
merged 2 commits into from
Oct 4, 2024
Merged

Pin numpy less than 2.0 #4

merged 2 commits into from
Oct 4, 2024

Conversation

roomrys
Copy link
Contributor

@roomrys roomrys commented Oct 2, 2024

In the main SLEAP repo, we recently re-ran a CI test on GA (without any changes to the source code) and were experiencing errors when importing tensorflow:

2024-10-02 16:45:05.510427: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory; LD_LIBRARY_PATH: /home/runner/miniconda3/envs/sleap_ci/lib:
2024-10-02 16:45:05.510483: I tensorflow/stream_executor/cuda/cudart_stub.cc:2[9](https://github.com/talmolab/sleap/actions/runs/11147955727/job/30983484433#step:6:10)] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
ImportError while loading conftest '/home/runner/work/sleap/sleap/tests/conftest.py'.
tests/conftest.py:9: in <module>
    from tests.fixtures.skeletons import *
tests/fixtures/skeletons.py:3: in <module>
    from sleap.skeleton import Skeleton
sleap/__init__.py:14: in <module>
    import sleap.nn
sleap/nn/__init__.py:1: in <module>
    import sleap.nn.architectures
sleap/nn/architectures/__init__.py:1: in <module>
    from sleap.nn.architectures import leap
sleap/nn/architectures/leap.py:[10](https://github.com/talmolab/sleap/actions/runs/11147955727/job/30983484433#step:6:11): in <module>
    from sleap.nn.architectures import encoder_decoder
sleap/nn/architectures/encoder_decoder.py:29: in <module>
    import tensorflow as tf
../../../miniconda3/envs/sleap_ci/lib/python3.10/site-packages/tensorflow/__init__.py:37: in <module>
    from tensorflow.python.tools import module_util as _module_util
../../../miniconda3/envs/sleap_ci/lib/python3.10/site-packages/tensorflow/python/__init__.py:37: in <module>
    from tensorflow.python.eager import context
../../../miniconda3/envs/sleap_ci/lib/python3.10/site-packages/tensorflow/python/eager/context.py:29: in <module>
    from tensorflow.core.framework import function_pb2
../../../miniconda3/envs/sleap_ci/lib/python3.10/site-packages/tensorflow/core/framework/function_pb2.py:[16](https://github.com/talmolab/sleap/actions/runs/11147955727/job/30983484433#step:6:17): in <module>
    from tensorflow.core.framework import attr_value_pb2 as tensorflow_dot_core_dot_framework_dot_attr__value__pb2
../../../miniconda3/envs/sleap_ci/lib/python3.10/site-packages/tensorflow/core/framework/attr_value_pb2.py:16: in <module>
    from tensorflow.core.framework import tensor_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__pb2
../../../miniconda3/envs/sleap_ci/lib/python3.10/site-packages/tensorflow/core/framework/tensor_pb2.py:16: in <module>
    from tensorflow.core.framework import resource_handle_pb2 as tensorflow_dot_core_dot_framework_dot_resource__handle__pb2
../../../miniconda3/envs/sleap_ci/lib/python3.10/site-packages/tensorflow/core/framework/resource_handle_pb2.py:16: in <module>
    from tensorflow.core.framework import tensor_shape_pb2 as tensorflow_dot_core_dot_framework_dot_tensor__shape__pb2
../../../miniconda3/envs/sleap_ci/lib/python3.10/site-packages/tensorflow/core/framework/tensor_shape_pb2.py:36: in <module>
    _descriptor.FieldDescriptor(
../../../miniconda3/envs/sleap_ci/lib/python3.10/site-packages/google/protobuf/descriptor.py:621: in __new__
    _message.Message._CheckCalledFromGeneratedFile()
E   TypeError: Descriptors cannot be created directly.
E   If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.[19](https://github.com/talmolab/sleap/actions/runs/11147955727/job/30983484433#step:6:20).0.
E   If you cannot immediately regenerate your protos, some other possible workarounds are:
E    1. Downgrade the protobuf package to 3.[20](https://github.com/talmolab/sleap/actions/runs/11147955727/job/30983484433#step:6:21).x or lower.
E    2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

This PR aims to fix those errors by adding additional constraints to the tensorflow package.

@roomrys roomrys marked this pull request as draft October 2, 2024 22:24
@roomrys
Copy link
Contributor Author

roomrys commented Oct 4, 2024

The build upload for mac failed since we already have the same build number and version uploaded on anaconda. Due to the fail-fast flag, the Linux and Windows uploads also failed. I manually downloaded and uploaded the WIndows and Linux build to the sleap-deps main channel. The tests seem to be passing, so I at least think that this is a step in the right direction.

@roomrys roomrys marked this pull request as ready for review October 4, 2024 22:35
@roomrys roomrys merged commit 660c0a1 into main Oct 4, 2024
3 of 6 checks passed
@roomrys roomrys deleted the liezl/pin-numpy-less-than-2.0 branch October 4, 2024 22:36
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

Successfully merging this pull request may close these issues.

1 participant