icatcherplus / icatcher_plus

iCatcher+: Robust and automated annotation of infant gaze from videos collected in laboratory, field, and online studies
GNU General Public License v3.0
17 stars 19 forks source link

issue with face classifier; segmentation fault error on Mac M1 #4

Closed annikamh406 closed 2 years ago

annikamh406 commented 2 years ago

Hi, I have two questions that may or may not be related:

  1. I can't find a .pth file that looks like a face classifier. Is it supposed to be one of the .py files in the face_classifier folder, or am I missing it somewhere?

  2. I think this might be unrelated, but whenever I try to run it I get a segmentation fault error. Specifically, I enter:

(env) MacBook-Pro-133:icatcher_plus annika$ python test.py datasets/test_eye_tracking.mp4 models/icatcher+_bw-cali.pth

and I get back the following message:

INFO:root:using the following values for per-channel mean: [0.485, 0.456, 0.406] INFO:root:using the following values for per-channel std: [0.229, 0.224, 0.225] Segmentation fault: 11

I again don't know if this is relevant, but when I created the conda environment, I got the following warning:

/Users/annika/miniconda/lib/python3.8/site-packages/requests/init.py:89: RequestsDependencyWarning: urllib3 (1.26.7) or chardet (3.0.4) doesn't match a supported version!

So sorry for the slightly confused question, but do you have a sense of what's going on here? Thanks so much!

yoterel commented 2 years ago

For (1), have you downloaded the model files ? (see step 3 in README). Assuming you want to use the full iCatcher+ pipeline, please also pass the --fc_model flag with the location of the face classifier file e.g.: python test.py datasets/test_eye_tracking.mp4 models/icatcher+_bw-cali.pth --fc_model models/face_classifier_lookit_weights_best.pt

The segmentation fault is weird in any case. I will try reproducing this with a Mac and get back to you. Can you post the version of python, CPU architecture, and OS version you are using?

for CPU archi: sysctl -a | grep brand

for complete conda info (post here please): conda list

annikamh406 commented 2 years ago

Thank you! I did download the model files, I just wasn't sure because it seemed like it should be a .pth file in the instructions.

python version: 3.8.13 CPU architecture: Apple M1 OS: MacOS Monterey Version 12.5.1 conda info:

# packages in environment at /Users/annika/miniconda/envs/env: # # Name Version Build Channel absl-py 0.15.0 pyhd3eb1b0_0 anaconda aiohttp 3.8.1 py38hca72f7f_1 anaconda aiosignal 1.2.0 pyhd3eb1b0_0 anaconda async-timeout 4.0.1 pyhd3eb1b0_0 anaconda attrs 21.4.0 pyhd3eb1b0_0 anaconda blas 1.0 mkl anaconda blinker 1.4 py38hecd8cb5_0 anaconda bottleneck 1.3.4 py38h67323c0_0 anaconda brotli 1.0.9 hb1e8313_2 anaconda brotlipy 0.7.0 py38h9ed2024_1003 anaconda bzip2 1.0.8 h1de35cc_0 anaconda c-ares 1.18.1 hca72f7f_0 anaconda ca-certificates 2022.4.26 hecd8cb5_0 anaconda cachetools 4.2.2 pyhd3eb1b0_0 anaconda certifi 2022.6.15 py38hecd8cb5_0 anaconda cffi 1.15.0 py38hc55c11b_1 anaconda charset-normalizer 2.0.4 pyhd3eb1b0_0 anaconda click 8.0.4 py38hecd8cb5_0 anaconda cryptography 37.0.1 py38hf6deb26_0 anaconda cycler 0.11.0 pyhd3eb1b0_0 anaconda dataclasses 0.8 pyh6d0b6a4_7 anaconda ffmpeg 4.3 h0a44026_0 pytorch ffmpeg-python 0.2.0 py_0 conda-forge fonttools 4.25.0 pyhd3eb1b0_0 anaconda freetype 2.11.0 hd8bbffd_0 anaconda frozenlist 1.2.0 py38hca72f7f_0 anaconda future 0.18.2 py38_1 anaconda gettext 0.21.0 h7535e17_0 anaconda giflib 5.2.1 haf1e3a3_0 anaconda gmp 6.2.1 he9d5cce_3 anaconda gnutls 3.6.15 hed9c0bf_0 anaconda google-auth 2.6.0 pyhd3eb1b0_0 anaconda google-auth-oauthlib 0.4.1 py_2 anaconda grpcio 1.42.0 py38ha29bfda_0 anaconda icu 58.2 h0a44026_3 anaconda idna 3.3 pyhd3eb1b0_0 anaconda importlib-metadata 4.11.3 py38hecd8cb5_0 anaconda iniconfig 1.1.1 pyhd3eb1b0_0 anaconda intel-openmp 2021.4.0 hecd8cb5_3538 anaconda joblib 1.1.0 pyhd3eb1b0_0 anaconda jpeg 9e hca72f7f_0 anaconda kiwisolver 1.4.2 py38he9d5cce_0 anaconda lame 3.100 h1de35cc_0 anaconda lcms2 2.12 hf1fd2bf_0 anaconda libcxx 12.0.0 h2f01273_0 anaconda libffi 3.3 hb1e8313_2 anaconda libgfortran 3.0.1 h93005f0_2 anaconda libiconv 1.16 hca72f7f_2 anaconda libidn2 2.3.2 h9ed2024_0 anaconda libpng 1.6.37 ha441bb4_0 anaconda libprotobuf 3.20.1 h8346a28_0 anaconda libtasn1 4.16.0 h9ed2024_0 anaconda libtiff 4.2.0 hdb42f99_1 anaconda libunistring 0.9.10 h9ed2024_0 anaconda libwebp 1.2.2 h56c3ce4_0 anaconda libwebp-base 1.2.2 hca72f7f_0 anaconda libxml2 2.9.14 hbf8cd5e_0 anaconda littleutils 0.2.2 py_0 conda-forge llvm-openmp 12.0.0 h0dcd299_1 anaconda lz4-c 1.9.3 h23ab428_1 anaconda markdown 3.3.4 py38hecd8cb5_0 anaconda matplotlib 3.5.1 py38hecd8cb5_1 anaconda matplotlib-base 3.5.1 py38hfb0c5b7_1 anaconda mkl 2021.4.0 hecd8cb5_637 anaconda mkl-service 2.4.0 py38h9ed2024_0 anaconda mkl_fft 1.3.1 py38h4ab4a9b_0 anaconda mkl_random 1.2.2 py38hb2f4e1b_0 anaconda mpmath 1.2.1 py38hecd8cb5_0 anaconda multidict 5.2.0 py38hca72f7f_2 anaconda munkres 1.1.4 py_0 anaconda ncurses 6.3 hca72f7f_2 anaconda nettle 3.7.3 h230ac6f_1 anaconda numexpr 2.8.1 py38h2e5f0a9_2 anaconda numpy 1.22.3 py38h2e5f0a9_0 anaconda numpy-base 1.22.3 py38h3b1a694_0 anaconda oauthlib 3.1.0 py_0 anaconda opencv-python 4.6.0.66 pypi_0 pypi openh264 2.1.1 h8346a28_0 anaconda openssl 1.1.1o hca72f7f_0 anaconda outdated 0.2.1 pyhd8ed1ab_0 conda-forge packaging 21.3 pyhd3eb1b0_0 anaconda pandas 1.4.2 py38he9d5cce_0 anaconda pandas-flavor 0.2.0 py_0 conda-forge patsy 0.5.2 py38hecd8cb5_1 anaconda pillow 9.0.1 py38hde71d04_0 anaconda pingouin 0.5.2 pyhd8ed1ab_0 conda-forge pip 21.2.4 py38hecd8cb5_0 anaconda pluggy 1.0.0 py38hecd8cb5_1 anaconda protobuf 3.20.1 py38he9d5cce_0 anaconda py 1.11.0 pyhd3eb1b0_0 anaconda pyasn1 0.4.8 pyhd3eb1b0_0 anaconda pyasn1-modules 0.2.8 py_0 anaconda pycparser 2.21 pyhd3eb1b0_0 anaconda pyjwt 1.7.1 py38_0 anaconda pyopenssl 22.0.0 pyhd3eb1b0_0 anaconda pyparsing 3.0.4 pyhd3eb1b0_0 anaconda pysocks 1.7.1 py38_1 anaconda pytest 7.1.2 py38hecd8cb5_0 anaconda python 3.8.13 hdfd78df_0 anaconda python-dateutil 2.8.2 pyhd3eb1b0_0 anaconda pytorch 1.12.1 py3.8_0 pytorch pytz 2022.1 py38hecd8cb5_0 anaconda readline 8.1.2 hca72f7f_1 anaconda requests 2.27.1 pyhd3eb1b0_0 anaconda requests-oauthlib 1.3.0 py_0 anaconda rsa 4.7.2 pyhd3eb1b0_1 anaconda scikit-learn 1.0.2 py38hae1ba45_1 anaconda scipy 1.7.3 py38h8c7af03_0 anaconda seaborn 0.11.2 pyhd3eb1b0_0 anaconda setuptools 61.2.0 py38hecd8cb5_0 anaconda six 1.16.0 pyhd3eb1b0_1 anaconda sqlite 3.38.5 h707629a_0 anaconda statsmodels 0.13.2 py38hca72f7f_0 anaconda tabulate 0.8.9 py38hecd8cb5_0 anaconda tensorboard 2.6.0 py_1 anaconda tensorboard-data-server 0.6.0 py38h5896577_0 anaconda tensorboard-plugin-wit 1.6.0 py_0 anaconda threadpoolctl 2.2.0 pyh0d69192_0 anaconda tk 8.6.12 h5d9f67b_0 anaconda tomli 1.2.2 pyhd3eb1b0_0 anaconda torchvision 0.13.1 py38_cpu pytorch tornado 6.1 py38h9ed2024_0 anaconda tqdm 4.64.0 py38hecd8cb5_0 anaconda typing-extensions 4.1.1 hd3eb1b0_0 anaconda typing_extensions 4.1.1 pyh06a4308_0 anaconda urllib3 1.26.9 py38hecd8cb5_0 anaconda werkzeug 2.0.3 pyhd3eb1b0_0 anaconda wheel 0.37.1 pyhd3eb1b0_0 anaconda xarray 0.20.1 pyhd3eb1b0_1 anaconda xz 5.2.5 hca72f7f_1 anaconda yarl 1.6.3 py38h9ed2024_0 anaconda zipp 3.8.0 py38hecd8cb5_0 anaconda zlib 1.2.12 h4dc903c_2 anaconda zstd 1.5.2 hcb37349_0 anaconda

yoterel commented 2 years ago

I cannot reproduce this on an intel Mac. I do not have access to M1 Mac. But can you try replacing the python=3.8 dependency with python=3.9 in the environment.yml file and redo all the installation steps from step 2 in the README ?

please create a differently named environment when doing so in step (2). i.e. after editing environment.yml do:

conda env create -n env2 -f environment.yml

and later on

conda activate env2

According to a quick google search there might be problems with python3.8 and M1 Macs. So this might solve the issue.