question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Good detections but calibration routine crashes

See original GitHub issue

Hi,

I’m using 5 cameras and the standard charuco board for camera calibration. This results in 100’s of detections per camera and anipose-calibrate makes it to the point where it saves detections.pickle. However, during the actual model estimation step, it crashes with the following

Calibrating...
/media/jon/Ephys Data Buffe/mouse_young_b/2020-09-03_mouse-young_b
/media/jon/Ephys Data Buffe/mouse_young_b/2020-09-03_mouse-young_b/calibration/calibration.toml
/media/jon/Ephys Data Buffe/mouse_young_b/2020-09-03_mouse-young_b/calibration/cam-0_2020-09-03T18_15_36.avi
100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 7043/7043 [02:45<00:00, 42.51it/s]
4676 boards detected
/media/jon/Ephys Data Buffe/mouse_young_b/2020-09-03_mouse-young_b/calibration/cam-1_2020-09-03T18_15_36.avi
100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 7043/7043 [03:04<00:00, 38.08it/s]
5149 boards detected
/media/jon/Ephys Data Buffe/mouse_young_b/2020-09-03_mouse-young_b/calibration/cam-2_2020-09-03T18_15_36.avi
100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 7043/7043 [03:12<00:00, 36.55it/s]
5403 boards detected
/media/jon/Ephys Data Buffe/mouse_young_b/2020-09-03_mouse-young_b/calibration/cam-3_2020-09-03T18_15_36.avi
100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 7043/7043 [03:01<00:00, 38.74it/s]
5122 boards detected
/media/jon/Ephys Data Buffe/mouse_young_b/2020-09-03_mouse-young_b/calibration/cam-4_2020-09-03T18_15_36.avi
100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 7043/7043 [03:02<00:00, 38.49it/s]
6628 boards detected
defaultdict(<class 'int'>, {('1', '4'): 4900, ('4', '1'): 4900})
Traceback (most recent call last):
  File "/home/jon/anaconda3/envs/anipose/bin/anipose", line 8, in <module>
    sys.exit(cli())
  File "/home/jon/anaconda3/envs/anipose/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/jon/anaconda3/envs/anipose/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/jon/anaconda3/envs/anipose/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/jon/anaconda3/envs/anipose/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/jon/anaconda3/envs/anipose/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/jon/anaconda3/envs/anipose/lib/python3.7/site-packages/click/decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/home/jon/anaconda3/envs/anipose/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/jon/anaconda3/envs/anipose/lib/python3.7/site-packages/anipose/anipose.py", line 314, in run_data
    calibrate_all(config)
  File "/home/jon/anaconda3/envs/anipose/lib/python3.7/site-packages/anipose/common.py", line 168, in fun
    return process_all(config, process_session, **args)
  File "/home/jon/anaconda3/envs/anipose/lib/python3.7/site-packages/anipose/common.py", line 153, in process_all
    output[past_folders] = process_session(config, path, **args)
  File "/home/jon/anaconda3/envs/anipose/lib/python3.7/site-packages/anipose/calibrate.py", line 203, in process_session
    verbose=True)
  File "/home/jon/anaconda3/envs/anipose/lib/python3.7/site-packages/aniposelib/cameras.py", line 1563, in calibrate_rows
    rvecs, tvecs = get_initial_extrinsics(rtvecs)
  File "/home/jon/anaconda3/envs/anipose/lib/python3.7/site-packages/aniposelib/utils.py", line 173, in get_initial_extrinsics
    pairs = find_calibration_pairs(graph, source=0)
  File "/home/jon/anaconda3/envs/anipose/lib/python3.7/site-packages/aniposelib/utils.py", line 156, in find_calibration_pairs
    for new in graph[item]:
TypeError: 'NoneType' object is not subscriptable

I’ve attached my detections.pickle in case there is evidence of what corner case I’ve reached here…

detections.zip

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:28 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
kevinyamauchicommented, Nov 9, 2020

Hello everyone! I have been trying to run the tutorial and I have run into this same issue. After running the tutorial as-is, I noticed there were different number of board detections in each video. I then trimmed the video down to the first 1200 frames and there are 1200 board detections in all three calibration videos (per the terminal outputt - see traceback below). I still received the same NoneType error. I have pasted the traceback and my conda environment info below. Also, I’ve attached the detections.pickle file.

traceback

Calibrating...
C:\Users\realtime\Downloads\hand-demo-unfilled-20201109T151316Z-001\hand-demo-unfilled\2019-08-02
C:\Users\realtime\Downloads\hand-demo-unfilled-20201109T151316Z-001\hand-demo-unfilled\2019-08-02\calibration\calibration.toml
C:\Users\realtime\Downloads\hand-demo-unfilled-20201109T151316Z-001\hand-demo-unfilled\2019-08-02\calibration\calib-charuco-trim-camA.mov
100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1200/1200 [00:40<00:00, 29.36it/s]
1200 boards detected
C:\Users\realtime\Downloads\hand-demo-unfilled-20201109T151316Z-001\hand-demo-unfilled\2019-08-02\calibration\calib-charuco-trim-camB.mov
100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1200/1200 [00:43<00:00, 27.56it/s]
1200 boards detected
C:\Users\realtime\Downloads\hand-demo-unfilled-20201109T151316Z-001\hand-demo-unfilled\2019-08-02\calibration\calib-charuco-trim-camC.mov
100%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1200/1200 [00:42<00:00, 28.08it/s]
1200 boards detected
defaultdict(<class 'int'>, {('A', 'B'): 1200, ('B', 'A'): 1200})
Traceback (most recent call last):
  File "c:\users\realtime\anaconda3\envs\anipose-dlc\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\realtime\anaconda3\envs\anipose-dlc\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\realtime\anaconda3\envs\anipose-dlc\Scripts\anipose.exe\__main__.py", line 7, in <module>
  File "c:\users\realtime\anaconda3\envs\anipose-dlc\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\realtime\anaconda3\envs\anipose-dlc\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "c:\users\realtime\anaconda3\envs\anipose-dlc\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\realtime\anaconda3\envs\anipose-dlc\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\realtime\anaconda3\envs\anipose-dlc\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "c:\users\realtime\anaconda3\envs\anipose-dlc\lib\site-packages\click\decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "c:\users\realtime\anaconda3\envs\anipose-dlc\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "c:\users\realtime\anaconda3\envs\anipose-dlc\lib\site-packages\anipose\anipose.py", line 116, in calibrate
    calibrate_all(config)
  File "c:\users\realtime\anaconda3\envs\anipose-dlc\lib\site-packages\anipose\common.py", line 168, in fun
    return process_all(config, process_session, **args)
  File "c:\users\realtime\anaconda3\envs\anipose-dlc\lib\site-packages\anipose\common.py", line 153, in process_all
    output[past_folders] = process_session(config, path, **args)
  File "c:\users\realtime\anaconda3\envs\anipose-dlc\lib\site-packages\anipose\calibrate.py", line 203, in process_session
    verbose=True)
  File "c:\users\realtime\anaconda3\envs\anipose-dlc\lib\site-packages\aniposelib\cameras.py", line 1563, in calibrate_rows
    rvecs, tvecs = get_initial_extrinsics(rtvecs)
  File "c:\users\realtime\anaconda3\envs\anipose-dlc\lib\site-packages\aniposelib\utils.py", line 173, in get_initial_extrinsics
    pairs = find_calibration_pairs(graph, source=0)
  File "c:\users\realtime\anaconda3\envs\anipose-dlc\lib\site-packages\aniposelib\utils.py", line 156, in find_calibration_pairs
    for new in graph[item]:
TypeError: 'NoneType' object is not subscriptable

environment

# packages in environment at C:\Users\realtime\anaconda3\envs\anipose-dlc:
#
# Name                    Version                   Build  Channel
_tflow_select             2.1.0                       gpu
absl-py                   0.11.0           py37haa95532_0
anipose                   0.9.0                    pypi_0    pypi
aniposelib                0.4.1                    pypi_0    pypi
apptools                  4.5.0                      py_0
argon2-cffi               20.1.0           py37he774522_1
astor                     0.8.1                    py37_0
async_generator           1.10             py37h28b3542_0
attrs                     20.3.0             pyhd3eb1b0_0
backcall                  0.2.0                      py_0
blas                      1.0                         mkl
bleach                    3.2.1                      py_0
bzip2                     1.0.8                he774522_0
ca-certificates           2020.10.14                    0
certifi                   2020.6.20          pyhd3eb1b0_3
cffi                      1.14.3           py37h7a1dbc1_0
chardet                   3.0.4                    pypi_0    pypi
click                     7.1.2                    pypi_0    pypi
colorama                  0.4.4                      py_0
configobj                 5.0.6                    py37_1
cudatoolkit               10.0.130                      0
cudnn                     7.6.5                cuda10.0_0
curl                      7.71.1               h2a8f88b_1
cycler                    0.10.0                   pypi_0    pypi
decorator                 4.4.2                      py_0
deeplabcut                2.1.8.2                  pypi_0    pypi
defusedxml                0.6.0                      py_0
easydict                  1.9                      pypi_0    pypi
entrypoints               0.3                      py37_0
envisage                  4.9.2                      py_0
expat                     2.2.10               h33f27b4_2
ffmpeg                    4.2.2                he774522_0
freetype                  2.10.4               hd328e21_0
future                    0.18.2                   py37_1
gast                      0.4.0                      py_0
geos                      3.8.0                h33f27b4_0
grpcio                    1.31.0           py37he7da953_0
h5py                      2.10.0           py37h5e291fa_0
hdf4                      4.2.13               h712560f_2
hdf5                      1.10.4               h7ebc959_0
icc_rt                    2019.0.0             h0cc432a_1
icu                       58.2                 ha925a31_3
idna                      2.10                     pypi_0    pypi
imageio                   2.9.0                    pypi_0    pypi
imageio-ffmpeg            0.4.2                    pypi_0    pypi
imgaug                    0.4.0                    pypi_0    pypi
importlib-metadata        2.0.0                      py_1
importlib_metadata        2.0.0                         1
intel-openmp              2019.0                   pypi_0    pypi
ipykernel                 5.3.4            py37h5ca1d4c_0
ipython                   7.19.0           py37hd4e2768_0
ipython_genutils          0.2.0                    py37_0
ipywidgets                7.5.1                      py_1
jedi                      0.17.2                   py37_0
jinja2                    2.11.2                     py_0
joblib                    0.17.0                   pypi_0    pypi
jpeg                      9b                   hb83a4c4_2
jsoncpp                   1.8.4                h74a9793_0
jsonschema                3.2.0                      py_2
jupyter                   1.0.0                    py37_7
jupyter_client            6.1.7                      py_0
jupyter_console           6.2.0                      py_0
jupyter_core              4.6.3                    py37_0
jupyterlab_pygments       0.1.2                      py_0
keras-applications        1.0.8                      py_1
keras-preprocessing       1.1.0                      py_1
kiwisolver                1.3.1                    pypi_0    pypi
krb5                      1.18.2               hc04afaa_0
libcurl                   7.71.1               h2a8f88b_1
libiconv                  1.15                 h1df5818_7
libnetcdf                 4.6.1                h411e497_2
libpng                    1.6.37               h2a8f88b_0
libprotobuf               3.13.0.1             h200bbdf_0
libsodium                 1.0.18               h62dcd97_0
libssh2                   1.9.0                h7a1dbc1_1
libtiff                   4.1.0                h56a325e_0
libxml2                   2.9.10               hb89e7f3_3
llvmlite                  0.33.0                   pypi_0    pypi
lz4-c                     1.8.1.2              h2fa13f4_0
m2w64-gcc-libgfortran     5.3.0                         6
m2w64-gcc-libs            5.3.0                         7
m2w64-gcc-libs-core       5.3.0                         7
m2w64-gmp                 6.1.0                         2
m2w64-libwinpthread-git   5.0.0.4634.697f757               2
markdown                  3.3.2                    py37_0
markupsafe                1.1.1            py37hfa6e2cd_1
matplotlib                3.0.3                    pypi_0    pypi
mayavi                    4.7.1            py37h11817fe_2
mistune                   0.8.4           py37hfa6e2cd_1001
mkl                       2020.2                      256
mkl-service               2.3.0            py37hb782905_0
mkl_fft                   1.2.0            py37h45dec08_0
mkl_random                1.1.1            py37h47e9c7a_0
mock                      4.0.2                      py_0
moviepy                   1.0.1                    pypi_0    pypi
msgpack                   1.0.0                    pypi_0    pypi
msgpack-numpy             0.4.7.1                  pypi_0    pypi
msys2-conda-epoch         20160418                      1
nb_conda                  2.2.1                    py37_0
nb_conda_kernels          2.3.0                    py37_0
nbclient                  0.5.1                      py_0
nbconvert                 6.0.7                    py37_0
nbformat                  5.0.8                      py_0
nest-asyncio              1.4.1                      py_0
networkx                  2.5                      pypi_0    pypi
notebook                  6.1.4                    py37_0
numba                     0.50.1                   pypi_0    pypi
numexpr                   2.7.1                    pypi_0    pypi
numpy                     1.16.4                   pypi_0    pypi
numpy-base                1.19.2           py37ha3acd2a_0
opencv-contrib-python     3.4.11.45                pypi_0    pypi
openssl                   1.1.1h               he774522_0
packaging                 20.4                       py_0
pandas                    1.1.4                    pypi_0    pypi
pandoc                    2.11                 h9490d1a_0
pandocfilters             1.4.2                    py37_1
parso                     0.7.0                      py_0
patsy                     0.5.1                    pypi_0    pypi
pickleshare               0.7.5                 py37_1001
pillow                    8.0.1                    pypi_0    pypi
pip                       20.2.4           py37haa95532_0
proglog                   0.1.9                    pypi_0    pypi
prometheus_client         0.8.0                      py_0
prompt-toolkit            3.0.8                      py_0
prompt_toolkit            3.0.8                         0
protobuf                  3.13.0.1         py37ha925a31_1
psutil                    5.7.3                    pypi_0    pypi
pycparser                 2.20                       py_2
pyface                    7.1.0                    py37_1
pygments                  2.7.2              pyhd3eb1b0_0
pyparsing                 2.4.7                      py_0
pyqt                      5.9.2            py37h6538335_2
pyreadline                2.1                      py37_1
pyrsistent                0.17.3           py37he774522_0
python                    3.7.9                h60c2a47_0
python-dateutil           2.8.1                      py_0
pytz                      2020.4                   pypi_0    pypi
pywavelets                1.1.1                    pypi_0    pypi
pywin32                   227              py37he774522_1
pywinpty                  0.5.7                    py37_0
pyyaml                    5.3.1                    pypi_0    pypi
pyzmq                     19.0.2           py37ha925a31_1
qt                        5.9.7            vc14h73c81de_0
qtconsole                 4.7.7                      py_0
qtpy                      1.9.0                      py_0
requests                  2.24.0                   pypi_0    pypi
ruamel-yaml               0.16.12                  pypi_0    pypi
ruamel-yaml-clib          0.2.2                    pypi_0    pypi
scikit-image              0.17.2                   pypi_0    pypi
scikit-learn              0.23.2                   pypi_0    pypi
scikit-video              1.1.11                   pypi_0    pypi
scipy                     1.5.2            py37h9439919_0
send2trash                1.5.0                    py37_0
setuptools                50.3.1           py37haa95532_1
shapely                   1.7.1            py37h210f175_0
sip                       4.19.8           py37h6538335_0
six                       1.15.0                     py_0
sqlite                    3.33.0               h2a8f88b_0
statsmodels               0.12.1                   pypi_0    pypi
tables                    3.6.1                    pypi_0    pypi
tabulate                  0.8.7                    pypi_0    pypi
tbb                       2020.3               h74a9793_0
tensorboard               1.13.1           py37h33f27b4_0
tensorflow                1.13.1          gpu_py37h83e5d6a_0
tensorflow-base           1.13.1          gpu_py37h871c8ca_0
tensorflow-estimator      1.13.0                     py_0
tensorflow-gpu            1.13.1               h0d30ee6_0
tensorpack                0.10.1                   pypi_0    pypi
termcolor                 1.1.0                    py37_1
terminado                 0.9.1                    py37_0
testpath                  0.4.4                      py_0
threadpoolctl             2.1.0                    pypi_0    pypi
tifffile                  2020.10.1                pypi_0    pypi
toml                      0.10.2                   pypi_0    pypi
tornado                   6.0.4            py37he774522_1
tqdm                      4.51.0                   pypi_0    pypi
traitlets                 5.0.5                      py_0
traits                    6.1.1            py37he774522_0
traitsui                  7.1.0                      py_0
urllib3                   1.25.11                  pypi_0    pypi
vc                        14.1                 h0510ff6_4
vs2015_runtime            14.16.27012          hf0eaf9b_3
vtk                       8.2.0           py37h1e53df8_200
wcwidth                   0.2.5                      py_0
webencodings              0.5.1                    py37_1
werkzeug                  1.0.1                      py_0
wheel                     0.35.1                     py_0
widgetsnbextension        3.5.1                    py37_0
wincertstore              0.2                      py37_0
winpty                    0.4.3                         4
wxpython                  4.0.4            py37ha925a31_0
xz                        5.2.5                h62dcd97_0
zeromq                    4.3.2                ha925a31_3
zipp                      3.4.0              pyhd3eb1b0_0
zlib                      1.2.11               h62dcd97_4
zstd                      1.3.7                h508b16e_0

detections.zip

Quick update: I rolled back to anipose==0.8.1 and aniposelib==0.3.7 and the calibration runs (I haven’t had a chance to evaluate the results)

1reaction
KonradDanielewskicommented, Mar 22, 2021

Ye, had the same issue, it makes detections worse. Rolling back 0.8.1 and 0.3.7 + upgrade calligator, for some reason, was the only way I got everything working fine and reproducible.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Do Simulated Traffic Conflicts Predict Crashes? An ...
This finding implies the possibility of predicting crashes reliably from simulated conflicts with proper calibration. Published in: 2019 IEEE IntelligentΒ ...
Read more >
An extreme value theory based approach for calibration of ...
Extreme value theory (EVT) provides a statistical tool that can enable the extrapolation from simulated traffic conflicts to extreme events such as crashes....
Read more >
Calibration/Development of Safety Performance Functions for ...
Latitude and longitude readings of crashes are of utmost importance for assigning crashes to intersections. To determine whether a crash is intersection-relatedΒ ...
Read more >
Calibration Comparison for Total Crashes Versus Fatal Plus Injury ...
The Highway Safety Manual (HSM) provides consistent predictive methods for estimating the predicted average crash frequency, but an appropriate calibration ...
Read more >
MINI calibration software crashes - Support & Feedback
Does Revo Calibration work for the MINI? ... i don't get any crash but the scanner disconnected when I try with ... Oh...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found