MouseLand / facemap

Framework for predicting neural activity from mouse orofacial movements tracked using a pose estimation model. Package also includes singular value decomposition (SVD) of behavioral videos.
https://facemap.readthedocs.io
GNU General Public License v3.0
154 stars 61 forks source link

BUG: <ValueError: too many values to unpack (expected 3)> #150

Closed ytjiang-98 closed 3 weeks ago

ytjiang-98 commented 2 months ago

Version information:

facemap version: 1.0.7.dev5+g7f6981c platform: win32 python version: 3.10.14 torch version: 2.3.1+cu121 numpy version: 1.26.4

Describe the issue:

Thank you for such brilliant work! when I tried to use motSVD for further analysis, it always appeared "ValueError: too many values to unpack (expected 3),even I used the example video you offered online." it looks like something wrong when PCA processing. And when I open the saved proc.npy file, the motSVD data is empty. 1720332006537

Error message:

** TORCH CUDA version installed and working. **
Computing subsampled mean...
QGraphicsScene::removeItem: item 0x1e877df8930's scene (0x0) is different from this scene (0x1e858745cf0)
Computed subsampled mean at 8.64s
Computing ROIs and/or motSVD/movSVD
Computed ROIS and/or motSVD/movSVD at 42.78s
run time 59.64s
QGraphicsScene::removeItem: item 0x1e82a247220's scene (0x0) is different from this scene (0x1e858745cf0)
QGraphicsScene::removeItem: item 0x1e82a247220's scene (0x0) is different from this scene (0x1e858745cf0)
Output saved in D:/Neuropixel/facemap/facemap_exeample videos/facemap video
QGraphicsScene::removeItem: item 0x1e82a247220's scene (0x0) is different from this scene (0x1e858745cf0)
Computing subsampled mean...
Computed subsampled mean at 9.12s
Computing subsampled SVD...
Traceback (most recent call last):
  File "C:\Users\zx\Anaconda3\envs\facemap\lib\site-packages\facemap\gui\gui.py", line 1288, in process_ROIs
    savename = process.run(
  File "C:\Users\zx\Anaconda3\envs\facemap\lib\site-packages\facemap\process.py", line 766, in run
    U_mot, U_mov, S_mot, S_mov = compute_SVD(
  File "C:\Users\zx\Anaconda3\envs\facemap\lib\site-packages\facemap\process.py", line 229, in compute_SVD
    usv = utils.svdecon(lilbin.T, k=ncb)
  File "C:\Users\zx\Anaconda3\envs\facemap\lib\site-packages\facemap\utils.py", line 757, in svdecon
    U, Sv, V = PCA(
ValueError: too many values to unpack (expected 3)
ytjiang-98 commented 2 months ago

this is my pip list Package Version


alabaster 0.7.16 Babel 2.11.0 Brotli 1.0.9 certifi 2024.7.4 charset-normalizer 2.0.4 colorama 0.4.6 contourpy 1.2.0 cycler 0.11.0 docutils 0.18.1 facemap 1.0.6 filelock 3.15.4 fonttools 4.51.0 fsspec 2024.6.1 h5py 3.11.0 idna 3.7 imagesize 1.4.1 intel-openmp 2021.4.0 Jinja2 3.1.4 joblib 1.4.2 kiwisolver 1.4.4 llvmlite 0.43.0 MarkupSafe 2.1.3 matplotlib 3.8.4 mkl 2021.4.0 mkl-fft 1.3.8 mkl-random 1.2.4 mkl-service 2.4.0 mpmath 1.3.0 natsort 8.4.0 networkx 3.3 numba 0.60.0 numpy 1.26.4 opencv-python-headless 4.10.0.84 packaging 24.1 pillow 10.3.0 pip 24.0 ply 3.11 Pygments 2.15.1 pyparsing 3.0.9 PyQt5 5.15.10 PyQt5-sip 12.13.0 PyQt6 6.7.0 PyQt6-Qt6 6.7.2 PyQt6-sip 13.6.0 pyqtgraph 0.13.7 PySocks 1.7.1 python-dateutil 2.9.0.post0 pytz 2024.1 QtPy 2.4.1 requests 2.32.2 scikit-learn 1.5.1 scipy 1.14.0 setuptools 69.5.1 sip 6.7.12 six 1.16.0 snowballstemmer 2.2.0 Sphinx 7.3.7 sphinxcontrib-applehelp 1.0.2 sphinxcontrib-devhelp 1.0.2 sphinxcontrib-htmlhelp 2.0.0 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.3 sphinxcontrib-serializinghtml 1.1.10 sympy 1.13.0 tbb 2021.13.0 threadpoolctl 3.5.0 torch 2.3.1+cu121 torchaudio 2.3.1+cu121 torchvision 0.18.1+cu121 tornado 6.4.1 tqdm 4.66.4 typing_extensions 4.12.2 unicodedata2 15.1.0 urllib3 2.2.2 wheel 0.43.0 win-inet-pton 1.1.0

Atika-Syeda commented 1 month ago

Hi @ytjiang-98 it looks like you're using the dev version: facemap version: 1.0.7.dev5+g7f6981c. Can you please install the latest stable version i.e. 1.0.6 and try running with that. If you still get an error then please share which checkboxes are selected before you process and if you're using any ROIs.

greg11111111 commented 1 month ago

I have the same issue... The facemap version that I'm using is 1.0.6 The checkboxes that I have checked in the Process settings are motSVD, movSVD, Save *.mat and multivideo (the others aren't checked). I also have a pupil ROI.

greg11111111 commented 1 month ago

So I did the following changes and I got it to work...