talmolab / sleap

A deep learning framework for multi-animal pose tracking.
https://sleap.ai
Other
427 stars 97 forks source link

Cannot select videos that are in the project #1660

Closed bdy2530 closed 8 months ago

bdy2530 commented 8 months ago

Bug description

After opening the .slp file with many videos in it, the Videos tab appears empty. I cannot choose which video I'd like to be on and I'm stuck on video 1.

Expected behaviour

the Videos tab should show the list of 264 videos

Actual behaviour

the Videos tab is empty, OSError: [Errno 24] Too many open files

Your personal set up

Environment packages ``` absl-py==1.4.0 aiohttp==3.8.4 aiohttp-socks==0.8.0 aiosignal==1.3.1 alembic==1.10.4 astunparse @ file:///home/conda/feedstock_root/build_artifacts/astunparse_1610696312422/work async-generator==1.10 async-timeout==4.0.2 attrs @ file:///home/conda/feedstock_root/build_artifacts/attrs_1683424013410/work beautifulsoup4==4.12.2 blinker @ file:///home/conda/feedstock_root/build_artifacts/blinker_1698890160476/work Brotli @ file:///Users/runner/miniforge3/conda-bld/brotli-split_1687884292427/work cached-property @ file:///home/conda/feedstock_root/build_artifacts/cached_property_1615209429212/work cachetools==5.3.1 cattrs @ file:///home/conda/feedstock_root/build_artifacts/cattrs_1604136207372/work certifi @ file:///home/conda/feedstock_root/build_artifacts/certifi_1700303426725/work/certifi cffi @ file:///Users/runner/miniforge3/conda-bld/cffi_1696001750083/work charset-normalizer==3.2.0 click @ file:///home/conda/feedstock_root/build_artifacts/click_1692311806742/work contourpy @ file:///Users/runner/miniforge3/conda-bld/contourpy_1699041715246/work cryptography @ file:///Users/runner/miniforge3/conda-bld/cryptography-split_1672673285537/work cycler @ file:///home/conda/feedstock_root/build_artifacts/cycler_1696677705766/work efficientnet==1.0.0 exceptiongroup==1.1.1 flatbuffers @ file:///home/conda/feedstock_root/build_artifacts/python-flatbuffers_1617723079010/work fonttools @ file:///Users/runner/miniforge3/conda-bld/fonttools_1702929755604/work frozenlist==1.3.3 gast @ file:///home/conda/feedstock_root/build_artifacts/gast_1596839682936/work google-auth==2.23.0 google-auth-oauthlib @ file:///home/conda/feedstock_root/build_artifacts/google-auth-oauthlib_1630497468950/work google-pasta==0.2.0 greenlet==2.0.2 grpcio @ file:///Users/runner/miniforge3/conda-bld/grpc-split_1660663644663/work h11==0.14.0 h5py @ file:///Users/runner/miniforge3/conda-bld/h5py_1674499003063/work hdmf==3.9.0 idna==3.4 image-classifiers==1.0.0 imagecodecs @ file:///Users/runner/miniforge3/conda-bld/imagecodecs_1668867616820/work imageio @ file:///home/conda/feedstock_root/build_artifacts/imageio_1702571712725/work imgaug @ file:///home/conda/feedstock_root/build_artifacts/imgaug_1640909786103/work imgstore==0.2.9 importlib-metadata @ file:///home/conda/feedstock_root/build_artifacts/importlib-metadata_1701632192416/work importlib-resources @ file:///home/conda/feedstock_root/build_artifacts/importlib_resources_1699364556997/work joblib @ file:///home/conda/feedstock_root/build_artifacts/joblib_1691577114857/work jsmin @ file:///home/conda/feedstock_root/build_artifacts/jsmin_1642532731678/work jsonpickle==1.2 jsonschema==4.19.0 jsonschema-specifications==2023.7.1 keras @ file:///home/conda/feedstock_root/build_artifacts/keras_1652925255303/work/keras-2.9.0-py2.py3-none-any.whl Keras-Applications==1.0.8 Keras-Preprocessing @ file:///home/conda/feedstock_root/build_artifacts/keras-preprocessing_1610713559828/work kiwisolver @ file:///Users/runner/miniforge3/conda-bld/kiwisolver_1695380068083/work lazy_loader @ file:///home/conda/feedstock_root/build_artifacts/lazy_loader_1692295373316/work libclang==16.0.6 lxml==4.9.2 Mako==1.2.4 Markdown==3.4.4 markdown-it-py @ file:///home/conda/feedstock_root/build_artifacts/markdown-it-py_1686175045316/work MarkupSafe @ file:///Users/runner/miniforge3/conda-bld/markupsafe_1695367493730/work matplotlib @ file:///Users/runner/miniforge3/conda-bld/matplotlib-suite_1700509536728/work mdurl @ file:///home/conda/feedstock_root/build_artifacts/mdurl_1639515908913/work mergedeep==1.3.4 multidict==6.0.4 munkres==1.1.4 ndx-pose==0.1.1 networkx @ file:///home/conda/feedstock_root/build_artifacts/networkx_1698504735452/work nixio==1.5.3 numpy @ file:///Users/runner/miniforge3/conda-bld/numpy_1653325964689/work oauthlib @ file:///home/conda/feedstock_root/build_artifacts/oauthlib_1666056362788/work opencv-python==4.6.0 opt-einsum @ file:///home/conda/feedstock_root/build_artifacts/opt_einsum_1696448916724/work outcome==1.2.0 packaging @ file:///home/conda/feedstock_root/build_artifacts/packaging_1696202382185/work pandas @ file:///Users/runner/miniforge3/conda-bld/pandas_1702057217217/work patsy @ file:///home/conda/feedstock_root/build_artifacts/patsy_1701443970942/work Pillow @ file:///Users/runner/miniforge3/conda-bld/pillow_1666920692505/work protobuf==3.19.6 psutil==5.9.5 pyasn1==0.5.0 pyasn1-modules @ file:///home/conda/feedstock_root/build_artifacts/pyasn1-modules_1695107857548/work pycparser @ file:///home/conda/feedstock_root/build_artifacts/pycparser_1636257122734/work Pygments @ file:///home/conda/feedstock_root/build_artifacts/pygments_1700607939962/work PyJWT @ file:///home/conda/feedstock_root/build_artifacts/pyjwt_1689721553971/work pykalman==0.9.5 pynwb==2.5.0 pyOpenSSL @ file:///home/conda/feedstock_root/build_artifacts/pyopenssl_1685514481738/work pyparsing @ file:///home/conda/feedstock_root/build_artifacts/pyparsing_1690737849915/work PySide2==5.15.8 PySocks @ file:///home/conda/feedstock_root/build_artifacts/pysocks_1661604839144/work python-dateutil @ file:///home/conda/feedstock_root/build_artifacts/python-dateutil_1626286286081/work python-rapidjson @ file:///Users/runner/miniforge3/conda-bld/python-rapidjson_1702546825178/work python-socks==2.2.0 pytz @ file:///home/conda/feedstock_root/build_artifacts/pytz_1693930252784/work pyu2f @ file:///home/conda/feedstock_root/build_artifacts/pyu2f_1604248910016/work PyWavelets @ file:///Users/runner/miniforge3/conda-bld/pywavelets_1695567624647/work PyYAML @ file:///Users/runner/miniforge3/conda-bld/pyyaml_1695373497981/work pyzmq @ file:///Users/runner/miniforge3/conda-bld/pyzmq_1701783274137/work qimage2ndarray==1.10.0 QtPy @ file:///home/conda/feedstock_root/build_artifacts/qtpy_1698112029416/work referencing==0.30.2 requests==2.29.0 requests-oauthlib @ file:///home/conda/feedstock_root/build_artifacts/requests-oauthlib_1643557462909/work rich @ file:///home/conda/feedstock_root/build_artifacts/rich-split_1700160075651/work/dist rpds-py==0.10.3 rsa @ file:///home/conda/feedstock_root/build_artifacts/rsa_1658328885051/work ruamel.yaml==0.17.32 ruamel.yaml.clib==0.2.7 scikit-image @ file:///Users/runner/miniforge3/conda-bld/scikit-image_1697028708231/work/dist/scikit_image-0.22.0-cp39-cp39-macosx_11_0_arm64.whl#sha256=9605b7cbaf5dbcce5929736982478cf3ff5d49a35cd99f5884151ad389b3a94d scikit-learn @ file:///Users/runner/miniforge3/conda-bld/scikit-learn_1632611447519/work scikit-video==1.1.11 scipy==1.9.0 seaborn @ file:///home/conda/feedstock_root/build_artifacts/seaborn-split_1696262444380/work segmentation-models==1.0.1 selenium==4.9.0 selenium-wire==2.1.2 shapely @ file:///Users/runner/miniforge3/conda-bld/shapely_1700762951808/work shiboken2==5.15.8 six==1.15.0 sleap==1.3.3 sortedcontainers==2.4.0 SQLAlchemy==1.4.20 statsmodels @ file:///Users/runner/miniforge3/conda-bld/statsmodels_1702575718670/work tensorboard @ file:///home/conda/feedstock_root/build_artifacts/tensorboard_1651519171059/work/tensorboard-2.9.0-py3-none-any.whl tensorboard-data-server @ file:///Users/runner/miniforge3/conda-bld/tensorboard-data-server_1670043861058/work/tensorboard_data_server-0.6.1-py3-none-macosx_11_0_arm64.whl tensorboard-plugin-wit @ file:///home/conda/feedstock_root/build_artifacts/tensorboard-plugin-wit_1641458951060/work/tensorboard_plugin_wit-1.8.1-py3-none-any.whl tensorflow @ file:///Users/ngam/Repos/tensorflow-feedstock/miniforge3/conda-bld/tensorflow-split_1658102176686/work/tensorflow_pkg/tensorflow-2.9.1-cp39-cp39-macosx_11_0_arm64.whl tensorflow-estimator @ file:///Users/ngam/Repos/tensorflow-feedstock/miniforge3/conda-bld/tensorflow-split_1658102176686/work/tensorflow-estimator/wheel_dir/tensorflow_estimator-2.9.0-py2.py3-none-any.whl tensorflow-hub @ file:///home/conda/feedstock_root/build_artifacts/tensorflow-hub_1618768305670/work/wheel_dir/tensorflow_hub-0.12.0-py2.py3-none-any.whl tensorflow-macos==2.9.2 tensorflow-metal==0.5.0 termcolor @ file:///home/conda/feedstock_root/build_artifacts/termcolor_1682317048417/work threadpoolctl @ file:///home/conda/feedstock_root/build_artifacts/threadpoolctl_1689261241048/work tifffile @ file:///home/conda/feedstock_root/build_artifacts/tifffile_1665588749940/work tqdm==4.65.0 trio==0.22.0 trio-websocket==0.10.2 typing_extensions @ file:///home/conda/feedstock_root/build_artifacts/typing_extensions_1702176139754/work tzdata @ file:///home/conda/feedstock_root/build_artifacts/python-tzdata_1680081134351/work tzlocal==5.0.1 ujson==5.7.0 unicodedata2 @ file:///Users/runner/miniforge3/conda-bld/unicodedata2_1695848020028/work urllib3==1.26.16 user-agent==0.1.10 Werkzeug==2.3.7 win32-setctime==1.1.0 wrapt==1.15.0 wsproto==1.2.0 yarl==1.9.2 zipp @ file:///home/conda/feedstock_root/build_artifacts/zipp_1695255097490/work ```
Logs ``` Software versions: SLEAP: 1.3.3 TensorFlow: 2.9.2 Numpy: 1.22.4 Python: 3.9.15 OS: macOS-14.1.2-arm64-arm-64bit Happy SLEAPing! :) OpenCV: Couldn't read video stream from file "/Volumes/fsmresfiles/Basic_Sciences/Phys/Lerner_Lab_tnl2633/Ryan/camera_stuff/video/Selected.for.training/cut LBN/LBNL4b_LBN_P18_3_2022-01-30_20-46-58.mp4" [ WARN:0@112.024] global /Users/runner/miniforge3/conda-bld/libopencv_1658995963829/work/modules/imgcodecs/src/loadsave.cpp (239) findDecoder imread_('/Volumes/fsmresfiles/Basic_Sciences/Phys/Lerner_Lab_tnl2633/Ryan/camera_stuff/video/Selected.for.training/cut LBN/LBNL4b_LBN_P18_3_2022-01-30_20-46-58.mp4'): can't open/read file: check file path/integrity Traceback (most recent call last): File "/Users/baran/mambaforge/envs/sleap/lib/python3.9/site-packages/sleap/gui/commands.py", line 289, in openProject File "/Users/baran/mambaforge/envs/sleap/lib/python3.9/site-packages/sleap/gui/commands.py", line 242, in execute File "/Users/baran/mambaforge/envs/sleap/lib/python3.9/site-packages/sleap/gui/commands.py", line 138, in execute File "/Users/baran/mambaforge/envs/sleap/lib/python3.9/site-packages/sleap/gui/commands.py", line 162, in do_with_signal File "/Users/baran/mambaforge/envs/sleap/lib/python3.9/site-packages/sleap/gui/commands.py", line 727, in do_action File "/Users/baran/mambaforge/envs/sleap/lib/python3.9/site-packages/sleap/gui/commands.py", line 274, in loadProjectFile File "/Users/baran/mambaforge/envs/sleap/lib/python3.9/site-packages/sleap/gui/commands.py", line 242, in execute File "/Users/baran/mambaforge/envs/sleap/lib/python3.9/site-packages/sleap/gui/commands.py", line 138, in execute File "/Users/baran/mambaforge/envs/sleap/lib/python3.9/site-packages/sleap/gui/commands.py", line 162, in do_with_signal File "/Users/baran/mambaforge/envs/sleap/lib/python3.9/site-packages/sleap/gui/commands.py", line 675, in do_action File "/Users/baran/mambaforge/envs/sleap/lib/python3.9/site-packages/sleap/gui/app.py", line 1166, in on_data_update File "/Users/baran/mambaforge/envs/sleap/lib/python3.9/site-packages/sleap/gui/dataviews.py", line 103, in items File "/Users/baran/mambaforge/envs/sleap/lib/python3.9/site-packages/sleap/gui/dataviews.py", line 392, in item_to_data File "/Users/baran/mambaforge/envs/sleap/lib/python3.9/site-packages/sleap/gui/dataviews.py", line 392, in File "/Users/baran/mambaforge/envs/sleap/lib/python3.9/site-packages/sleap/io/video.py", line 1046, in __getattr__ File "/Users/baran/mambaforge/envs/sleap/lib/python3.9/site-packages/sleap/io/video.py", line 461, in height File "/Users/baran/mambaforge/envs/sleap/lib/python3.9/site-packages/sleap/io/video.py", line 411, in test_frame File "/Users/baran/mambaforge/envs/sleap/lib/python3.9/site-packages/sleap/io/video.py", line 489, in get_frame File "/Users/baran/mambaforge/envs/sleap/lib/python3.9/site-packages/sleap/io/video.py", line 371, in __lock File "/Users/baran/mambaforge/envs/sleap/lib/python3.9/multiprocessing/context.py", line 73, in RLock File "/Users/baran/mambaforge/envs/sleap/lib/python3.9/multiprocessing/synchronize.py", line 187, in __init__ File "/Users/baran/mambaforge/envs/sleap/lib/python3.9/multiprocessing/synchronize.py", line 57, in __init__ OSError: [Errno 24] Too many open files ```

Screenshots

Screenshot 2024-01-12 at 11 34 24

How to reproduce

  1. Open a large .slp file with many videos
  2. Click on 'Videos'
  3. It is empty
talmo commented 8 months ago

Hi @bdy2530,

Judging from this error:

OSError: [Errno 24] Too many open files

It looks like the problem is that there are too many videos in your project 😢

This is an issue with how Macs limit the number of open files at the operating system level.

You can try a couple of things:

  1. Try to increase the limit of open files allowable by the OS. This Superuser question has some suggestions on how to do this.
  2. Reduce the number of videos in your project. If you haven't made much progress in your labeling yet, it's probably easier to start a new project. If you need to recover your currently un-openable project, we can help with a little script to split up your project.

Let us know if that works for you!

Cheers,

Talmo

bdy2530 commented 8 months ago

Hi Talmo,

Thank you for the quick response! I solved this issue by doing 'ulimit -n 4096' before 'conda activate sleap' and now all the videos appear as normal.

Best, Baran