I've installed sleap in new environment with GPU support using: conda create --name sleap pip python=3.7.12 cudatoolkit=11.3 cudnn=8.2
These are the environments I have:
I was trying to open the interface after installing and it wasn't working and I originally had TensorFlow 2.7+ so I tried downgrading the TensorFlow 2.6 but this didn't fix the issue...
When I try : sleap-label...
Expected behaviour: see the SLEAP labeling interface pop up within a few moments, but instead I get this:
Actual behaviour:
(sleap) C:\Users\Andrew>sleap-label
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\sleap\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "C:\ProgramData\Anaconda3\envs\sleap\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\ProgramData\Anaconda3\envs\sleap\Scripts\sleap-label.exe__main.py", line 4, in
File "C:\ProgramData\Anaconda3\envs\sleap\lib\site-packages\sleap__init.py", line 14, in
import sleap.nn
File "C:\ProgramData\Anaconda3\envs\sleap\lib\site-packages\sleap\nn\init.py", line 1, in
import sleap.nn.architectures
File "C:\ProgramData\Anaconda3\envs\sleap\lib\site-packages\sleap\nn\architectures\init__.py", line 4, in
from sleap.nn.architectures import resnet
File "C:\ProgramData\Anaconda3\envs\sleap\lib\site-packages\sleap\nn\architectures\resnet.py", line 56, in
) -> Tuple[tf.keras.Model, List[IntermediateFeature]]:
File "C:\ProgramData\Anaconda3\envs\sleap\lib\site-packages\tensorflow\python\util\lazy_loader.py", line 62, in getattr
module = self._load()
File "C:\ProgramData\Anaconda3\envs\sleap\lib\site-packages\tensorflow\python\util\lazy_loader.py", line 45, in _load
module = importlib.import_module(self.name)
File "C:\ProgramData\Anaconda3\envs\sleap\lib\importlib\init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\Andrew\AppData\Roaming\Python\Python37\site-packages\keras\init.py", line 25, in
from keras import models
File "C:\Users\Andrew\AppData\Roaming\Python\Python37\site-packages\keras\models.py", line 20, in
from keras import metrics as metrics_module
File "C:\Users\Andrew\AppData\Roaming\Python\Python37\site-packages\keras\metrics.py", line 27, in
from keras import activations
File "C:\Users\Andrew\AppData\Roaming\Python\Python37\site-packages\keras\activations.py", line 20, in
from keras.layers import advanced_activations
File "C:\Users\Andrew\AppData\Roaming\Python\Python37\site-packages\keras\layers\init__.py", line 24, in
from keras.engine.input_layer import Input
File "C:\Users\Andrew\AppData\Roaming\Python\Python37\site-packages\keras\engine\input_layer.py", line 21, in
from keras.engine import base_layer
File "C:\Users\Andrew\AppData\Roaming\Python\Python37\site-packages\keras\engine\base_layer.py", line 41, in
from keras.mixed_precision import loss_scale_optimizer
File "C:\Users\Andrew\AppData\Roaming\Python\Python37\site-packages\keras\mixed_precision\loss_scale_optimizer.py", line 1180, in
mixed_precision._register_wrapper_optimizer_cls(optimizer_v2.OptimizerV2,
AttributeError: module 'tensorflow.python.training.experimental.mixed_precision' has no attribute '_register_wrapper_optimizer_cls'
I get essentially the same error when I try
python -c "import sleap; sleap.system_summary()"
python -c "import sleap; sleap.versions()"
sleap-diagnostic
Environment packages
``` see above
# paste output of `pip freeze` or `conda list` here
```
Logs
```
(sleap) C:\Users\Andrew>sleap-diagnostic
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\envs\sleap\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\ProgramData\Anaconda3\envs\sleap\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\ProgramData\Anaconda3\envs\sleap\Scripts\sleap-diagnostic.exe\__main__.py", line 4, in
File "C:\ProgramData\Anaconda3\envs\sleap\lib\site-packages\sleap\__init__.py", line 14, in
import sleap.nn
File "C:\ProgramData\Anaconda3\envs\sleap\lib\site-packages\sleap\nn\__init__.py", line 1, in
import sleap.nn.architectures
File "C:\ProgramData\Anaconda3\envs\sleap\lib\site-packages\sleap\nn\architectures\__init__.py", line 4, in
from sleap.nn.architectures import resnet
File "C:\ProgramData\Anaconda3\envs\sleap\lib\site-packages\sleap\nn\architectures\resnet.py", line 56, in
) -> Tuple[tf.keras.Model, List[IntermediateFeature]]:
File "C:\ProgramData\Anaconda3\envs\sleap\lib\site-packages\tensorflow\python\util\lazy_loader.py", line 62, in __getattr__
module = self._load()
File "C:\ProgramData\Anaconda3\envs\sleap\lib\site-packages\tensorflow\python\util\lazy_loader.py", line 45, in _load
module = importlib.import_module(self.__name__)
File "C:\ProgramData\Anaconda3\envs\sleap\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\Andrew\AppData\Roaming\Python\Python37\site-packages\keras\__init__.py", line 25, in
from keras import models
File "C:\Users\Andrew\AppData\Roaming\Python\Python37\site-packages\keras\models.py", line 20, in
from keras import metrics as metrics_module
File "C:\Users\Andrew\AppData\Roaming\Python\Python37\site-packages\keras\metrics.py", line 27, in
from keras import activations
File "C:\Users\Andrew\AppData\Roaming\Python\Python37\site-packages\keras\activations.py", line 20, in
from keras.layers import advanced_activations
File "C:\Users\Andrew\AppData\Roaming\Python\Python37\site-packages\keras\layers\__init__.py", line 24, in
from keras.engine.input_layer import Input
File "C:\Users\Andrew\AppData\Roaming\Python\Python37\site-packages\keras\engine\input_layer.py", line 21, in
from keras.engine import base_layer
File "C:\Users\Andrew\AppData\Roaming\Python\Python37\site-packages\keras\engine\base_layer.py", line 41, in
from keras.mixed_precision import loss_scale_optimizer
File "C:\Users\Andrew\AppData\Roaming\Python\Python37\site-packages\keras\mixed_precision\loss_scale_optimizer.py", line 1180, in
mixed_precision._register_wrapper_optimizer_cls(optimizer_v2.OptimizerV2,
AttributeError: module 'tensorflow.python.training.experimental.mixed_precision' has no attribute '_register_wrapper_optimizer_cls'
```
# Bug description
I've installed sleap in new environment with GPU support using: conda create --name sleap pip python=3.7.12 cudatoolkit=11.3 cudnn=8.2 These are the environments I have:
conda environments:
# base C:\ProgramData\Anaconda3 DEEPLABCUT C:\ProgramData\Anaconda3\envs\DEEPLABCUT DLC C:\ProgramData\Anaconda3\envs\DLC minian C:\ProgramData\Anaconda3\envs\minian napari-env C:\ProgramData\Anaconda3\envs\napari-env sleap * C:\ProgramData\Anaconda3\envs\sleap caiman C:\Users\Andrew.conda\envs\caiman caiman_new C:\Users\Andrew.conda\envs\caiman_new C:\Users\Andrew\miniforge3
And these are the packages in sleap:
packages in environment at C:\ProgramData\Anaconda3\envs\sleap:
#
Name Version Build Channel
absl-py 0.15.0 pypi_0 pypi astunparse 1.6.3 pypi_0 pypi attrs 21.4.0 pypi_0 pypi backports-zoneinfo 0.2.1 pypi_0 pypi ca-certificates 2024.3.11 haa95532_0 cachetools 4.2.4 pypi_0 pypi cattrs 1.1.1 pypi_0 pypi certifi 2022.12.7 py37haa95532_0 charset-normalizer 3.3.2 pypi_0 pypi clang 5.0 pypi_0 pypi colorama 0.4.6 pypi_0 pypi commonmark 0.9.1 pypi_0 pypi cudatoolkit 11.3.1 h59b6b97_2 cudnn 8.2.1 cuda11.3_0 efficientnet 1.0.0 pypi_0 pypi flatbuffers 1.12 pypi_0 pypi fonttools 4.38.0 pypi_0 pypi gast 0.4.0 pypi_0 pypi google-auth 1.35.0 pypi_0 pypi google-auth-oauthlib 0.4.6 pypi_0 pypi google-pasta 0.2.0 pypi_0 pypi grpcio 1.62.2 pypi_0 pypi h5py 3.1.0 pypi_0 pypi hdmf 3.6.1 pypi_0 pypi idna 3.7 pypi_0 pypi image-classifiers 1.0.0 pypi_0 pypi imgstore 0.2.9 pypi_0 pypi importlib-metadata 4.2.0 pypi_0 pypi importlib-resources 5.12.0 pypi_0 pypi jsmin 3.0.1 pypi_0 pypi jsonpickle 1.2 pypi_0 pypi jsonschema 4.17.3 pypi_0 pypi keras 2.6.0 pypi_0 pypi keras-applications 1.0.8 pypi_0 pypi keras-preprocessing 1.1.2 pypi_0 pypi libclang 18.1.1 pypi_0 pypi markdown 3.3.4 pypi_0 pypi markupsafe 2.1.5 pypi_0 pypi matplotlib 3.5.3 pypi_0 pypi ndx-pose 0.1.1 pypi_0 pypi nixio 1.5.3 pypi_0 pypi numpy 1.19.5 pypi_0 pypi oauthlib 3.2.2 pypi_0 pypi opencv-python 4.5.5.64 pypi_0 pypi openssl 1.1.1w h2bbff1b_0 opt-einsum 3.3.0 pypi_0 pypi packaging 24.0 pypi_0 pypi pillow 8.4.0 pypi_0 pypi pip 22.3.1 py37haa95532_0 pkgutil-resolve-name 1.3.10 pypi_0 pypi protobuf 3.19.6 pypi_0 pypi pyasn1 0.5.1 pypi_0 pypi pyasn1-modules 0.3.0 pypi_0 pypi pygments 2.17.2 pypi_0 pypi pykalman 0.9.5 pypi_0 pypi pynwb 2.3.3 pypi_0 pypi pyparsing 3.1.2 pypi_0 pypi pyrsistent 0.19.3 pypi_0 pypi pyside2 5.14.1 pypi_0 pypi python 3.7.16 h6244533_0 python-dateutil 2.9.0.post0 pypi_0 pypi python-rapidjson 1.10 pypi_0 pypi pyzmq 26.0.3 pypi_0 pypi qimage2ndarray 1.10.0 pypi_0 pypi qtpy 2.4.1 pypi_0 pypi requests 2.31.0 pypi_0 pypi requests-oauthlib 2.0.0 pypi_0 pypi rich 10.16.1 pypi_0 pypi rsa 4.9 pypi_0 pypi scikit-learn 1.0.2 pypi_0 pypi scikit-video 1.1.11 pypi_0 pypi seaborn 0.12.2 pypi_0 pypi segmentation-models 1.0.1 pypi_0 pypi setuptools 65.6.3 py37haa95532_0 shiboken2 5.14.1 pypi_0 pypi sleap 1.3.3 pypi_0 pypi sqlite 3.45.3 h2bbff1b_0 tensorboard 2.6.0 pypi_0 pypi tensorboard-data-server 0.6.1 pypi_0 pypi tensorboard-plugin-wit 1.8.1 pypi_0 pypi tensorflow 2.6.3 pypi_0 pypi tensorflow-estimator 2.6.0 pypi_0 pypi tensorflow-hub 0.14.0 pypi_0 pypi tensorflow-io-gcs-filesystem 0.31.0 pypi_0 pypi typing-extensions 3.10.0.2 pypi_0 pypi tzdata 2024.1 pypi_0 pypi tzlocal 5.1 pypi_0 pypi urllib3 1.26.19 pypi_0 pypi vc 14.2 h2eaa2aa_4 vs2015_runtime 14.29.30133 h43f2093_4 werkzeug 2.2.3 pypi_0 pypi wheel 0.38.4 py37haa95532_0 wincertstore 0.2 py37haa95532_2 wrapt 1.12.1 pypi_0 pypi zipp 3.15.0 pypi_0 pypi
I was trying to open the interface after installing and it wasn't working and I originally had TensorFlow 2.7+ so I tried downgrading the TensorFlow 2.6 but this didn't fix the issue...
When I try : sleap-label...
Expected behaviour: see the SLEAP labeling interface pop up within a few moments, but instead I get this:
Actual behaviour:
(sleap) C:\Users\Andrew>sleap-label Traceback (most recent call last): File "C:\ProgramData\Anaconda3\envs\sleap\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "C:\ProgramData\Anaconda3\envs\sleap\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\ProgramData\Anaconda3\envs\sleap\Scripts\sleap-label.exe__main.py", line 4, in
File "C:\ProgramData\Anaconda3\envs\sleap\lib\site-packages\sleap__init.py", line 14, in
import sleap.nn
File "C:\ProgramData\Anaconda3\envs\sleap\lib\site-packages\sleap\nn\ init.py", line 1, in
import sleap.nn.architectures
File "C:\ProgramData\Anaconda3\envs\sleap\lib\site-packages\sleap\nn\architectures\ init__.py", line 4, in
from sleap.nn.architectures import resnet
File "C:\ProgramData\Anaconda3\envs\sleap\lib\site-packages\sleap\nn\architectures\resnet.py", line 56, in
) -> Tuple[tf.keras.Model, List[IntermediateFeature]]:
File "C:\ProgramData\Anaconda3\envs\sleap\lib\site-packages\tensorflow\python\util\lazy_loader.py", line 62, in getattr
module = self._load()
File "C:\ProgramData\Anaconda3\envs\sleap\lib\site-packages\tensorflow\python\util\lazy_loader.py", line 45, in _load
module = importlib.import_module(self.name)
File "C:\ProgramData\Anaconda3\envs\sleap\lib\importlib\init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\Andrew\AppData\Roaming\Python\Python37\site-packages\keras\init.py", line 25, in
from keras import models
File "C:\Users\Andrew\AppData\Roaming\Python\Python37\site-packages\keras\models.py", line 20, in
from keras import metrics as metrics_module
File "C:\Users\Andrew\AppData\Roaming\Python\Python37\site-packages\keras\metrics.py", line 27, in
from keras import activations
File "C:\Users\Andrew\AppData\Roaming\Python\Python37\site-packages\keras\activations.py", line 20, in
from keras.layers import advanced_activations
File "C:\Users\Andrew\AppData\Roaming\Python\Python37\site-packages\keras\layers\ init__.py", line 24, in
from keras.engine.input_layer import Input
File "C:\Users\Andrew\AppData\Roaming\Python\Python37\site-packages\keras\engine\input_layer.py", line 21, in
from keras.engine import base_layer
File "C:\Users\Andrew\AppData\Roaming\Python\Python37\site-packages\keras\engine\base_layer.py", line 41, in
from keras.mixed_precision import loss_scale_optimizer
File "C:\Users\Andrew\AppData\Roaming\Python\Python37\site-packages\keras\mixed_precision\loss_scale_optimizer.py", line 1180, in
mixed_precision._register_wrapper_optimizer_cls(optimizer_v2.OptimizerV2,
AttributeError: module 'tensorflow.python.training.experimental.mixed_precision' has no attribute '_register_wrapper_optimizer_cls'
I get essentially the same error when I try python -c "import sleap; sleap.system_summary()" python -c "import sleap; sleap.versions()" sleap-diagnostic
Your personal set up
Environment packages
``` see above # paste output of `pip freeze` or `conda list` here ```Logs
``` (sleap) C:\Users\Andrew>sleap-diagnostic Traceback (most recent call last): File "C:\ProgramData\Anaconda3\envs\sleap\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "C:\ProgramData\Anaconda3\envs\sleap\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\ProgramData\Anaconda3\envs\sleap\Scripts\sleap-diagnostic.exe\__main__.py", line 4, inScreenshots
How to reproduce