Problem in DLC installation

I just started with installing deeplabcut on a new system.
I tried running the testscript.py file, but I got an error:
analyze_videos() got an unexpected keyword argument ‘allow_growth’.

Is this something I should worry about? Is there any way to correct this?

1 Like

I have included some section of the code here:

CREATE VIDEO
E:\Users\Sanket\DeepLabCut\examples\TEST-Alex-2021-06-09\videos  already exists!
Starting to process video: E:\Users\Sanket\DeepLabCut\examples\TEST-Alex-2021-06-09\videos\reachingvideo1short.avi
Loading E:\Users\Sanket\DeepLabCut\examples\TEST-Alex-2021-06-09\videos\reachingvideo1short.avi and data.
Duration of video [s]: 1.0, recorded with 30.0 fps!
Overall # of frames: 30 with cropped frame dimensions: 832 747
Generating frames and creating video.
100%|██████████████████████████████████████████████████████████████████████████████████| 30/30 [00:04<00:00,  7.27it/s]
Labeled video E:\Users\Sanket\DeepLabCut\examples\TEST-Alex-2021-06-09\videos\reachingvideo1shortDLC_resnet50_TESTJun9shuffle1_5_labeled.mp4 successfully created.
Making plots
Loading  E:\Users\Sanket\DeepLabCut\examples\TEST-Alex-2021-06-09\videos\reachingvideo1short.avi and data.
Plots created! Please check the directory "plot-poses" within the video directory
EXTRACT OUTLIERS
Method  jump  found  29  putative outlier frames.
Do you want to proceed with extracting  5  of those?
If this list is very large, perhaps consider changing the parameters (start, stop, p_bound, comparisonbodyparts) or use a different method.
Loading video...
Duration of video [s]:  1.0 , recorded @  30.0 fps!
Overall # of frames:  30 with (cropped) frame dimensions:
Kmeans-quantization based extracting of frames from 0.0  seconds to 1.0  seconds.
Extracting and downsampling... 29  frames from the video.
29it [00:00, 232.80it/s]
Kmeans clustering ... (this might take a while)
Let's select frames indices: [8, 28, 15, 25, 1]
New video was added to the project! Use the function 'extract_frames' to select frames for labeling.
The outlier frames are extracted. They are stored in the subdirectory labeled-data\reachingvideo1short.
Once you extracted frames for all videos, use 'refine_labels' to manually correct the labels.
Fitting state-space models with parameters: 3 1
E:\Users\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\statsmodels\tsa\statespace\sarimax.py:966: UserWarning: Non-stationary starting autoregressive parameters found. Using zeros as starting parameters.
  warn('Non-stationary starting autoregressive parameters'
E:\Users\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\statsmodels\base\model.py:568: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
  ConvergenceWarning)
E:\Users\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\statsmodels\base\model.py:568: ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals
  ConvergenceWarning)
Method  fitting  found  30  putative outlier frames.
Do you want to proceed with extracting  5  of those?
If this list is very large, perhaps consider changing the parameters (start, stop, epsilon, ARdegree, MAdegree, alpha, comparisonbodyparts) or use a different method.
Frames from video reachingvideo1short  already extracted (more will be added)!
Loading video...
Duration of video [s]:  1.0 , recorded @  30.0 fps!
Overall # of frames:  30 with (cropped) frame dimensions:
Kmeans-quantization based extracting of frames from 0.0  seconds to 1.0  seconds.
Extracting and downsampling... 29  frames from the video.
29it [00:00, 232.77it/s]
Kmeans clustering ... (this might take a while)
Let's select frames indices: [29, 8, 25, 18, 16]
New video was added to the project! Use the function 'extract_frames' to select frames for labeling.
The outlier frames are extracted. They are stored in the subdirectory labeled-data\reachingvideo1short.
Once you extracted frames for all videos, use 'refine_labels' to manually correct the labels.
RELABELING
testscript.py:229: FutureWarning: inplace is deprecated and will be removed in a future version.
  DF.columns.set_levels([scorer.replace(DLCscorer, scorer)], level=0, inplace=True)
MERGING
Merged data sets and updated refinement iteration to 1.
Now you can create a new training set for the expanded annotated images (use create_training_dataset).
CREATING TRAININGSET
The training dataset is successfully created. Use the function 'train_network' to start training. Happy training!
CHANGING training parameters to end quickly!
TRAIN
Selecting single-animal trainer
Config:
{'Task': None,
 'TrainingFraction': None,
 'all_joints': [[0], [1], [2], [3]],
 'all_joints_names': ['bodypart1', 'bodypart2', 'bodypart3', 'objectA'],
 'alpha_r': 0.02,
 'alphavalue': None,
 'batch_size': 1,
 'bodyparts': None,
 'clahe': True,
 'claheratio': 0.1,
 'colormap': None,
 'corner2move2': None,
 'crop_pad': 0,
 'croppedtraining': None,
 'cropping': None,
 'cropratio': 0.4,
 'dataset': 'training-datasets\\iteration-1\\UnaugmentedDataSet_TESTJun9\\TEST_Alex80shuffle1.mat',
 'dataset_type': 'scalecrop',
 'date': None,
 'decay_steps': 30000,
 'default_augmenter': None,
 'default_net_type': None,
 'deterministic': False,
 'display_iters': 1,
 'dotsize': None,
 'edge': False,
 'emboss': {'alpha': [0.0, 1.0], 'embossratio': 0.1, 'strength': [0.5, 1.5]},
 'fg_fraction': 0.25,
 'global_scale': 0.8,
 'histeq': True,
 'histeqratio': 0.1,
 'init_weights': 'E:\\Users\\Sanket\\anaconda3\\envs\\DLC-CPU\\lib\\site-packages\\deeplabcut\\pose_estimation_tensorflow\\models\\pretrained\\resnet_v1_50.ckpt',
 'intermediate_supervision': False,
 'intermediate_supervision_layer': 12,
 'iteration': None,
 'location_refinement': True,
 'locref_huber_loss': True,
 'locref_loss_weight': 0.05,
 'locref_stdev': 7.2801,
 'log_dir': 'log',
 'lr_init': 0.0005,
 'max_input_size': 1500,
 'mean_pixel': [123.68, 116.779, 103.939],
 'metadataset': 'training-datasets\\iteration-1\\UnaugmentedDataSet_TESTJun9\\Documentation_data-TEST_80shuffle1.pickle',
 'min_input_size': 64,
 'mirror': False,
 'move2corner': None,
 'multi_step': [[0.001, 5]],
 'multianimalproject': None,
 'net_type': 'resnet_50',
 'num_joints': 4,
 'numframes2pick': None,
 'optimizer': 'sgd',
 'pairwise_huber_loss': False,
 'pairwise_predict': False,
 'partaffinityfield_predict': False,
 'pcutoff': None,
 'pos_dist_thresh': 17,
 'project_path': 'E:\\Users\\Sanket\\DeepLabCut\\examples\\TEST-Alex-2021-06-09',
 'regularize': False,
 'save_iters': 5,
 'scale_jitter_lo': 0.5,
 'scale_jitter_up': 1.25,
 'scoremap_dir': 'test',
 'scorer': None,
 'sharpen': False,
 'sharpenratio': 0.3,
 'shuffle': True,
 'skeleton': [],
 'skeleton_color': 'black',
 'snapshot_prefix': 'E:\\Users\\Sanket\\DeepLabCut\\examples\\TEST-Alex-2021-06-09\\dlc-models\\iteration-1\\TESTJun9-trainset80shuffle1\\train\\snapshot',
 'snapshotindex': None,
 'start': None,
 'stop': None,
 'stride': 8.0,
 'video_sets': None,
 'weigh_negatives': False,
 'weigh_only_present_joints': False,
 'weigh_part_predictions': False,
 'weight_decay': 0.0001,
 'x1': None,
 'x2': None,
 'y1': None,
 'y2': None}
Switching batchsize to 1, as tensorpack/scalecrop/deterministic loaders do not support batches >1. Use imgaug/default loader.
Starting with scalecrop pose-dataset loader.
Initializing ResNet
Loading ImageNet-pretrained resnet_50
Training parameter:
{'stride': 8.0, 'weigh_part_predictions': False, 'weigh_negatives': False, 'fg_fraction': 0.25, 'mean_pixel': [123.68, 116.779, 103.939], 'shuffle': True, 'snapshot_prefix': 'E:\\Users\\Sanket\\DeepLabCut\\examples\\TEST-Alex-2021-06-09\\dlc-models\\iteration-1\\TESTJun9-trainset80shuffle1\\train\\snapshot', 'log_dir': 'log', 'global_scale': 0.8, 'location_refinement': True, 'locref_stdev': 7.2801, 'locref_loss_weight': 0.05, 'locref_huber_loss': True, 'optimizer': 'sgd', 'intermediate_supervision': False, 'intermediate_supervision_layer': 12, 'regularize': False, 'weight_decay': 0.0001, 'crop_pad': 0, 'scoremap_dir': 'test', 'batch_size': 1, 'dataset_type': 'scalecrop', 'deterministic': False, 'mirror': False, 'pairwise_huber_loss': False, 'weigh_only_present_joints': False, 'partaffinityfield_predict': False, 'pairwise_predict': False, 'Task': None, 'scorer': None, 'date': None, 'multianimalproject': None, 'project_path': 'E:\\Users\\Sanket\\DeepLabCut\\examples\\TEST-Alex-2021-06-09', 'video_sets': None, 'bodyparts': None, 'start': None, 'stop': None, 'numframes2pick': None, 'skeleton': [], 'skeleton_color': 'black', 'pcutoff': None, 'dotsize': None, 'alphavalue': None, 'colormap': None, 'TrainingFraction': None, 'iteration': None, 'default_net_type': None, 'default_augmenter': None, 'snapshotindex': None, 'cropping': None, 'croppedtraining': None, 'x1': None, 'x2': None, 'y1': None, 'y2': None, 'corner2move2': None, 'move2corner': None, 'all_joints': [[0], [1], [2], [3]], 'all_joints_names': ['bodypart1', 'bodypart2', 'bodypart3', 'objectA'], 'alpha_r': 0.02, 'clahe': True, 'claheratio': 0.1, 'cropratio': 0.4, 'dataset': 'training-datasets\\iteration-1\\UnaugmentedDataSet_TESTJun9\\TEST_Alex80shuffle1.mat', 'decay_steps': 30000, 'display_iters': 1, 'edge': False, 'emboss': {'alpha': [0.0, 1.0], 'embossratio': 0.1, 'strength': [0.5, 1.5]}, 'histeq': True, 'histeqratio': 0.1, 'init_weights': 'E:\\Users\\Sanket\\anaconda3\\envs\\DLC-CPU\\lib\\site-packages\\deeplabcut\\pose_estimation_tensorflow\\models\\pretrained\\resnet_v1_50.ckpt', 'lr_init': 0.0005, 'max_input_size': 1500, 'metadataset': 'training-datasets\\iteration-1\\UnaugmentedDataSet_TESTJun9\\Documentation_data-TEST_80shuffle1.pickle', 'min_input_size': 64, 'multi_step': [[0.001, 5]], 'net_type': 'resnet_50', 'num_joints': 4, 'pos_dist_thresh': 17, 'save_iters': 5, 'scale_jitter_lo': 0.5, 'scale_jitter_up': 1.25, 'sharpen': False, 'sharpenratio': 0.3, 'crop': True, 'minsize': 100, 'leftwidth': 400, 'rightwidth': 400, 'topheight': 400, 'bottomheight': 400}
Starting training....
iteration: 1 loss: 1.7014 lr: 0.001
iteration: 2 loss: 0.7881 lr: 0.001
iteration: 3 loss: 0.6670 lr: 0.001
iteration: 4 loss: 0.6114 lr: 0.001
iteration: 5 loss: 0.5018 lr: 0.001
2021-06-09 11:44:54.580046: W tensorflow/core/kernels/queue_base.cc:277] _1_fifo_queue: Skipping cancelled enqueue attempt with queue not closed
Exception in thread Thread-7:
Traceback (most recent call last):
  File "E:\Users\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\tensorflow_core\python\client\session.py", line 1365, in _do_call
    return fn(*args)
  File "E:\Users\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\tensorflow_core\python\client\session.py", line 1350, in _run_fn
    target_list, run_metadata)
  File "E:\Users\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\tensorflow_core\python\client\session.py", line 1443, in _call_tf_sessionrun
    run_metadata)
tensorflow.python.framework.errors_impl.CancelledError: Enqueue operation was cancelled
         [[{{node fifo_queue_enqueue}}]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "E:\Users\Sanket\anaconda3\envs\DLC-CPU\lib\threading.py", line 926, in _bootstrap_inner
    self.run()
  File "E:\Users\Sanket\anaconda3\envs\DLC-CPU\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "E:\Users\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\deeplabcut\pose_estimation_tensorflow\train.py", line 91, in load_and_enqueue
    sess.run(enqueue_op, feed_dict=food)
  File "E:\Users\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\tensorflow_core\python\client\session.py", line 956, in run
    run_metadata_ptr)
  File "E:\Users\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\tensorflow_core\python\client\session.py", line 1180, in _run
    feed_dict_tensor, options, run_metadata)
  File "E:\Users\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\tensorflow_core\python\client\session.py", line 1359, in _do_run
    run_metadata)
  File "E:\Users\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\tensorflow_core\python\client\session.py", line 1384, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.CancelledError: Enqueue operation was cancelled
         [[node fifo_queue_enqueue (defined at \Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\tensorflow_core\python\framework\ops.py:1748) ]]

Original stack trace for 'fifo_queue_enqueue':
  File "\Sanket\anaconda3\envs\DLC-CPU\Scripts\ipython-script.py", line 10, in <module>
    sys.exit(start_ipython())
  File "\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\IPython\__init__.py", line 126, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\traitlets\config\application.py", line 844, in launch_instance
    app.initialize(argv)
  File "\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\traitlets\config\application.py", line 87, in inner
    return method(app, *args, **kwargs)
  File "\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\IPython\terminal\ipapp.py", line 323, in initialize
    self.init_code()
  File "\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\IPython\core\shellapp.py", line 328, in init_code
    self._run_cmd_line_code()
  File "\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\IPython\core\shellapp.py", line 453, in _run_cmd_line_code
    self._exec_file(fname, shell_futures=True)
  File "\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\IPython\core\shellapp.py", line 381, in _exec_file
    raise_exceptions=True)
  File "\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\IPython\core\interactiveshell.py", line 2763, in safe_execfile
    self.compile if shell_futures else None)
  File "\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\IPython\utils\py3compat.py", line 168, in execfile
    exec(compiler(f.read(), fname, 'exec'), glob, loc)
  File "\sanket\deeplabcut\examples\testscript.py", line 282, in <module>
    deeplabcut.train_network(path_config_file)
  File "\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\deeplabcut\pose_estimation_tensorflow\training.py", line 189, in train_network
    allow_growth=allow_growth,
  File "\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\deeplabcut\pose_estimation_tensorflow\train.py", line 176, in train
    batch, enqueue_op, placeholders = setup_preloading(batch_spec)
  File "\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\deeplabcut\pose_estimation_tensorflow\train.py", line 77, in setup_preloading
    enqueue_op = q.enqueue(placeholders_list)
  File "\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\tensorflow_core\python\ops\data_flow_ops.py", line 346, in enqueue
    self._queue_ref, vals, name=scope)
  File "\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\tensorflow_core\python\ops\gen_data_flow_ops.py", line 4409, in queue_enqueue_v2
    timeout_ms=timeout_ms, name=name)
  File "\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\tensorflow_core\python\framework\op_def_library.py", line 794, in _apply_op_helper
    op_def=op_def)
  File "\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\tensorflow_core\python\util\deprecation.py", line 507, in new_func
    return func(*args, **kwargs)
  File "\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\tensorflow_core\python\framework\ops.py", line 3357, in create_op
    attrs, op_def, compute_device)
  File "\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\tensorflow_core\python\framework\ops.py", line 3426, in _create_op_internal
    op_def=op_def)
  File "\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\tensorflow_core\python\framework\ops.py", line 1748, in __init__
    self._traceback = tf_stack.extract_stack()


The network is now trained and ready to evaluate. Use the function 'evaluate_network' to evaluate the network.
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 10.2.1 (GCC) 20200726
  configuration: --disable-static --enable-shared --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --enable-librav1e --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, avi, from 'E:\Users\sanket\deeplabcut\examples\Reaching-Mackenzie-2018-08-30\videos\reachingvideo1.avi':
  Duration: 00:00:08.53, start: 0.000000, bitrate: 12642 kb/s
    Stream #0:0: Video: mjpeg (Baseline) (MJPG / 0x47504A4D), yuvj420p(pc, bt470bg/unknown/unknown), 832x747 [SAR 1:1 DAR 832:747], 12682 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc
    Metadata:
      title           : ImageJ AVI
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> mpeg4 (native))
Press [q] to stop, [?] for help
[swscaler @ 0000015e025b8e00] deprecated pixel format used, make sure you did set range correctly
Output #0, avi, to 'E:\Users\Sanket\DeepLabCut\examples\TEST-Alex-2021-06-09\videos\reachingvideo1short2.avi':
  Metadata:
    ISFT            : Lavf58.45.100
    Stream #0:0: Video: mpeg4 (FMP4 / 0x34504D46), yuv420p, 832x747 [SAR 1:1 DAR 832:747], q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc
    Metadata:
      title           : ImageJ AVI
      encoder         : Lavc58.91.100 mpeg4
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
frame=   30 fps=0.0 q=31.0 Lsize=     236kB time=00:00:01.00 bitrate=1936.3kbits/s speed=  10x
video:230kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.768319%
Inference with direct cropping
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
E:\Users\sanket\deeplabcut\examples\testscript.py in <module>
    316         destfolder=dfolder,
    317         cropping=[0, 50, 0, 50],
--> 318         allow_growth=True
    319     )
    320

TypeError: analyze_videos() got an unexpected keyword argument 'allow_growth'

That means you have the newest testscript.py but your call somehow did not run the newest deeplabcut. Did you use one of the DLC yaml env files to create your env?

You can confirm the version with (inside ipython inside your env)

import deeplabcut
deeplabcut.__version__

should return 2.2rc2. If it doesn’t, run the following after activating your env

pip install 'deeplabcut[gui]'==2.2rc2

Or see the comments in this issue about this error, and how to run the vastest version.

I am unable to use this code, the pip install one. Instead, it resulted in the following error.

(DLC-CPU) PS E:\users\sanket\deeplabcut\examples> cd ..
(DLC-CPU) PS E:\users\sanket\deeplabcut> pip install 'deeplabcut[gui]'==2.2rc2
ERROR: Invalid requirement: '==2.2rc2'
(DLC-CPU) PS E:\users\sanket\deeplabcut> ipython
Python 3.7.10 | packaged by conda-forge | (default, Feb 19 2021, 15:37:01) [MSC v.1916 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.24.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import deeplabcut
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-1-cfa4f159dfc5> in <module>
----> 1 import deeplabcut

E:\users\sanket\deeplabcut\deeplabcut\__init__.py in <module>
     31
     32     mpl.use("WxAgg")
---> 33     from deeplabcut import generate_training_dataset
     34     from deeplabcut import refine_training_dataset
     35     from deeplabcut.generate_training_dataset import (

E:\users\sanket\deeplabcut\deeplabcut\generate_training_dataset\__init__.py in <module>
     10
     11 from deeplabcut.generate_training_dataset.frame_extraction import *
---> 12 from deeplabcut.generate_training_dataset.trainingsetmanipulation import *
     13 from deeplabcut.generate_training_dataset.multiple_individuals_trainingsetmanipulation import *

E:\users\sanket\deeplabcut\deeplabcut\generate_training_dataset\trainingsetmanipulation.py in <module>
     21 from skimage import io
     22
---> 23 from deeplabcut.pose_estimation_tensorflow import training
     24 from deeplabcut.utils import (
     25     auxiliaryfunctions,

E:\users\sanket\deeplabcut\deeplabcut\pose_estimation_tensorflow\__init__.py in <module>
     17 from deeplabcut.pose_estimation_tensorflow.models import *
     18 from deeplabcut.pose_estimation_tensorflow.nnet import *
---> 19 from deeplabcut.pose_estimation_tensorflow.predict_videos import *
     20
     21 # from deeplabcut.pose_estimation_tensorflow.predict_multianimal import convert_detections2tracklet

E:\users\sanket\deeplabcut\deeplabcut\pose_estimation_tensorflow\predict_videos.py in <module>
     29
     30 from deeplabcut.pose_estimation_tensorflow.config import load_config
---> 31 from deeplabcut.pose_estimation_tensorflow.lib import inferenceutils, trackingutils
     32 from deeplabcut.pose_estimation_tensorflow.nnet import predict
     33 from deeplabcut.utils import auxiliaryfunctions, auxfun_multianimal

E:\users\sanket\deeplabcut\deeplabcut\pose_estimation_tensorflow\lib\trackingutils.py in <module>
     40 from scipy.stats import mode
     41 from tqdm import tqdm
---> 42 from shapely.geometry import Polygon
     43
     44

E:\Users\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\shapely\geometry\__init__.py in <module>
      2 """
      3
----> 4 from .base import CAP_STYLE, JOIN_STYLE
      5 from .geo import box, shape, asShape, mapping
      6 from .point import Point, asPoint

E:\Users\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\shapely\geometry\base.py in <module>
     17
     18 from shapely.affinity import affine_transform
---> 19 from shapely.coords import CoordinateSequence
     20 from shapely.errors import WKBReadingError, WKTReadingError
     21 from shapely.geos import WKBWriter, WKTWriter

E:\Users\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\shapely\coords.py in <module>
      6 from ctypes import byref, c_double, c_uint
      7
----> 8 from shapely.geos import lgeos
      9 from shapely.topology import Validating
     10

E:\Users\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\shapely\geos.py in <module>
    152     if os.getenv('CONDA_PREFIX', ''):
    153         # conda package.
--> 154         _lgeos = CDLL(os.path.join(sys.prefix, 'Library', 'bin', 'geos_c.dll'))
    155     else:
    156         try:

E:\Users\Sanket\anaconda3\envs\DLC-CPU\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
    362
    363         if handle is None:
--> 364             self._handle = _dlopen(self._name, mode)
    365         else:
    366             self._handle = handle

OSError: [WinError 126] The specified module could not be found

It ran properly before the pip install code. Any idea how I can get out of this?

try

pip install deeplabcut[gui]==2.2rc2

I tried running the above line of code. Initially deeplabcut was working well. After running the update command, I am unable to even import the package. Please help.

(DLC-CPU) PS E:\users\sanket\deeplabcut\examples> cd ..
(DLC-CPU) PS E:\users\sanket\deeplabcut> pip install deeplabcut[gui]==2.2rc2
Collecting deeplabcut[gui]==2.2rc2
  Using cached deeplabcut-2.2rc2-py3-none-any.whl (709 kB)
Requirement already satisfied: six in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (1.16.0)
Requirement already satisfied: Pillow>=7.1 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (8.2.0)
Requirement already satisfied: matplotlib==3.1.3 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (3.1.3)
Requirement already satisfied: scikit-learn in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (0.24.2)
Requirement already satisfied: patsy in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (0.5.1)
Requirement already satisfied: scikit-image>=0.17 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (0.18.1)
Requirement already satisfied: networkx in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (2.5.1)
Requirement already satisfied: setuptools in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (49.6.0.post20210108)
Requirement already satisfied: cython in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (0.29.23)
Requirement already satisfied: ruamel.yaml>=0.15.0 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (0.17.9)
Requirement already satisfied: chardet in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (4.0.0)
Requirement already satisfied: h5py in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (2.10.0)
Requirement already satisfied: opencv-python-headless~=3.4.9.33 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (3.4.9.33)
Requirement already satisfied: ipython-genutils in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (0.2.0)
Requirement already satisfied: pandas>=1.0.1 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (1.2.4)
Requirement already satisfied: intel-openmp in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (2021.2.0)
Requirement already satisfied: click in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (8.0.1)
Requirement already satisfied: moviepy<=1.0.1 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (1.0.1)
Requirement already satisfied: numba==0.51.1 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (0.51.1)
Requirement already satisfied: filterpy in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (1.4.5)
Requirement already satisfied: python-dateutil in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (2.8.1)
Requirement already satisfied: imgaug in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (0.4.0)
Requirement already satisfied: tables in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (3.6.1)
Requirement already satisfied: tqdm in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (4.61.0)
Requirement already satisfied: certifi in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (2021.5.30)
Requirement already satisfied: pyyaml in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (5.4.1)
Requirement already satisfied: wheel in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (0.36.2)
Requirement already satisfied: tensorpack==0.9.8 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (0.9.8)
Requirement already satisfied: numpy~=1.17.3 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (1.17.5)
Requirement already satisfied: ipython in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (7.24.1)
Requirement already satisfied: statsmodels>=0.11 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (0.12.2)
Requirement already satisfied: scipy>=1.4 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (1.6.3)
Requirement already satisfied: wxpython<4.1 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from deeplabcut[gui]==2.2rc2) (4.0.7.post2)
Requirement already satisfied: cycler>=0.10 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from matplotlib==3.1.3->deeplabcut[gui]==2.2rc2) (0.10.0)
Requirement already satisfied: kiwisolver>=1.0.1 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from matplotlib==3.1.3->deeplabcut[gui]==2.2rc2) (1.3.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from matplotlib==3.1.3->deeplabcut[gui]==2.2rc2) (2.4.7)
Requirement already satisfied: llvmlite<0.35,>=0.34.0.dev0 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from numba==0.51.1->deeplabcut[gui]==2.2rc2) (0.34.0)
Requirement already satisfied: termcolor>=1.1 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from tensorpack==0.9.8->deeplabcut[gui]==2.2rc2) (1.1.0)
Requirement already satisfied: msgpack>=0.5.2 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from tensorpack==0.9.8->deeplabcut[gui]==2.2rc2) (1.0.2)
Requirement already satisfied: msgpack-numpy>=0.4.4.2 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from tensorpack==0.9.8->deeplabcut[gui]==2.2rc2) (0.4.7.1)
Requirement already satisfied: tabulate>=0.7.7 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from tensorpack==0.9.8->deeplabcut[gui]==2.2rc2) (0.8.9)
Requirement already satisfied: pyzmq>=16 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from tensorpack==0.9.8->deeplabcut[gui]==2.2rc2) (22.1.0)
Requirement already satisfied: psutil>=5 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from tensorpack==0.9.8->deeplabcut[gui]==2.2rc2) (5.8.0)
Requirement already satisfied: imageio-ffmpeg>=0.2.0 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from moviepy<=1.0.1->deeplabcut[gui]==2.2rc2) (0.4.4)
Requirement already satisfied: decorator<5.0,>=4.0.2 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from moviepy<=1.0.1->deeplabcut[gui]==2.2rc2) (4.4.2)
Requirement already satisfied: imageio<3.0,>=2.5 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from moviepy<=1.0.1->deeplabcut[gui]==2.2rc2) (2.9.0)
Requirement already satisfied: requests<3.0,>=2.8.1 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from moviepy<=1.0.1->deeplabcut[gui]==2.2rc2) (2.25.1)
Requirement already satisfied: proglog<=1.0.0 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from moviepy<=1.0.1->deeplabcut[gui]==2.2rc2) (0.1.9)
Requirement already satisfied: pytz>=2017.3 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from pandas>=1.0.1->deeplabcut[gui]==2.2rc2) (2021.1)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from requests<3.0,>=2.8.1->moviepy<=1.0.1->deeplabcut[gui]==2.2rc2) (1.26.5)
Requirement already satisfied: idna<3,>=2.5 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from requests<3.0,>=2.8.1->moviepy<=1.0.1->deeplabcut[gui]==2.2rc2) (2.10)
Requirement already satisfied: ruamel.yaml.clib>=0.1.2 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from ruamel.yaml>=0.15.0->deeplabcut[gui]==2.2rc2) (0.2.2)
Requirement already satisfied: tifffile>=2019.7.26 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from scikit-image>=0.17->deeplabcut[gui]==2.2rc2) (2021.6.6)
Requirement already satisfied: PyWavelets>=1.1.1 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from scikit-image>=0.17->deeplabcut[gui]==2.2rc2) (1.1.1)
Requirement already satisfied: colorama in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from click->deeplabcut[gui]==2.2rc2) (0.4.4)
Requirement already satisfied: importlib-metadata in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from click->deeplabcut[gui]==2.2rc2) (4.5.0)
Requirement already satisfied: opencv-python in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from imgaug->deeplabcut[gui]==2.2rc2) (4.5.2.54)
Requirement already satisfied: Shapely in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from imgaug->deeplabcut[gui]==2.2rc2) (1.7.1)
Requirement already satisfied: typing-extensions>=3.6.4 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from importlib-metadata->click->deeplabcut[gui]==2.2rc2) (3.10.0.0)
Requirement already satisfied: zipp>=0.5 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from importlib-metadata->click->deeplabcut[gui]==2.2rc2) (3.4.1)
Requirement already satisfied: pygments in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from ipython->deeplabcut[gui]==2.2rc2) (2.9.0)
Requirement already satisfied: pickleshare in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from ipython->deeplabcut[gui]==2.2rc2) (0.7.5)
Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from ipython->deeplabcut[gui]==2.2rc2) (3.0.18)
Requirement already satisfied: jedi>=0.16 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from ipython->deeplabcut[gui]==2.2rc2) (0.18.0)
Requirement already satisfied: matplotlib-inline in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from ipython->deeplabcut[gui]==2.2rc2) (0.1.2)
Requirement already satisfied: traitlets>=4.2 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from ipython->deeplabcut[gui]==2.2rc2) (5.0.5)
Requirement already satisfied: backcall in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from ipython->deeplabcut[gui]==2.2rc2) (0.2.0)
Requirement already satisfied: parso<0.9.0,>=0.8.0 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from jedi>=0.16->ipython->deeplabcut[gui]==2.2rc2) (0.8.2)
Requirement already satisfied: wcwidth in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython->deeplabcut[gui]==2.2rc2) (0.2.5)
Requirement already satisfied: threadpoolctl>=2.0.0 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from scikit-learn->deeplabcut[gui]==2.2rc2) (2.1.0)
Requirement already satisfied: joblib>=0.11 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from scikit-learn->deeplabcut[gui]==2.2rc2) (1.0.1)
Requirement already satisfied: numexpr>=2.6.2 in e:\users\sanket\anaconda3\envs\dlc-cpu\lib\site-packages (from tables->deeplabcut[gui]==2.2rc2) (2.7.3)
Installing collected packages: deeplabcut
  Attempting uninstall: deeplabcut
    Found existing installation: deeplabcut 2.1.10.4
    Uninstalling deeplabcut-2.1.10.4:
      Successfully uninstalled deeplabcut-2.1.10.4
Successfully installed deeplabcut-2.2rc2
(DLC-CPU) PS E:\users\sanket\deeplabcut> ipython
Python 3.7.10 | packaged by conda-forge | (default, Feb 19 2021, 15:37:01) [MSC v.1916 64 bit (AMD64)]
Type 'copyright', 'credits' or 'license' for more information
IPython 7.24.1 -- An enhanced Interactive Python. Type '?' for help.

In [1]: import deeplabcut
---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-1-cfa4f159dfc5> in <module>
----> 1 import deeplabcut

E:\users\sanket\deeplabcut\deeplabcut\__init__.py in <module>
     31
     32     mpl.use("WxAgg")
---> 33     from deeplabcut import generate_training_dataset
     34     from deeplabcut import refine_training_dataset
     35     from deeplabcut.generate_training_dataset import (

E:\users\sanket\deeplabcut\deeplabcut\generate_training_dataset\__init__.py in <module>
     10
     11 from deeplabcut.generate_training_dataset.frame_extraction import *
---> 12 from deeplabcut.generate_training_dataset.trainingsetmanipulation import *
     13 from deeplabcut.generate_training_dataset.multiple_individuals_trainingsetmanipulation import *

E:\users\sanket\deeplabcut\deeplabcut\generate_training_dataset\trainingsetmanipulation.py in <module>
     21 from skimage import io
     22
---> 23 from deeplabcut.pose_estimation_tensorflow import training
     24 from deeplabcut.utils import (
     25     auxiliaryfunctions,

E:\users\sanket\deeplabcut\deeplabcut\pose_estimation_tensorflow\__init__.py in <module>
     17 from deeplabcut.pose_estimation_tensorflow.models import *
     18 from deeplabcut.pose_estimation_tensorflow.nnet import *
---> 19 from deeplabcut.pose_estimation_tensorflow.predict_videos import *
     20
     21 # from deeplabcut.pose_estimation_tensorflow.predict_multianimal import convert_detections2tracklet

E:\users\sanket\deeplabcut\deeplabcut\pose_estimation_tensorflow\predict_videos.py in <module>
     29
     30 from deeplabcut.pose_estimation_tensorflow.config import load_config
---> 31 from deeplabcut.pose_estimation_tensorflow.lib import inferenceutils, trackingutils
     32 from deeplabcut.pose_estimation_tensorflow.nnet import predict
     33 from deeplabcut.utils import auxiliaryfunctions, auxfun_multianimal

E:\users\sanket\deeplabcut\deeplabcut\pose_estimation_tensorflow\lib\trackingutils.py in <module>
     40 from scipy.stats import mode
     41 from tqdm import tqdm
---> 42 from shapely.geometry import Polygon
     43
     44

E:\Users\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\shapely\geometry\__init__.py in <module>
      2 """
      3
----> 4 from .base import CAP_STYLE, JOIN_STYLE
      5 from .geo import box, shape, asShape, mapping
      6 from .point import Point, asPoint

E:\Users\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\shapely\geometry\base.py in <module>
     17
     18 from shapely.affinity import affine_transform
---> 19 from shapely.coords import CoordinateSequence
     20 from shapely.errors import WKBReadingError, WKTReadingError
     21 from shapely.geos import WKBWriter, WKTWriter

E:\Users\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\shapely\coords.py in <module>
      6 from ctypes import byref, c_double, c_uint
      7
----> 8 from shapely.geos import lgeos
      9 from shapely.topology import Validating
     10

E:\Users\Sanket\anaconda3\envs\DLC-CPU\lib\site-packages\shapely\geos.py in <module>
    152     if os.getenv('CONDA_PREFIX', ''):
    153         # conda package.
--> 154         _lgeos = CDLL(os.path.join(sys.prefix, 'Library', 'bin', 'geos_c.dll'))
    155     else:
    156         try:

E:\Users\Sanket\anaconda3\envs\DLC-CPU\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
    362
    363         if handle is None:
--> 364             self._handle = _dlopen(self._name, mode)
    365         else:
    366             self._handle = handle

OSError: [WinError 126] The specified module could not be found

You’re not the only person reporting this error, but not everyone is seeing it either.

You can try pip install Shapely

If that doesn’t work, there is a fix pending, but you’ll have to wait for it to be posted.

@jeylau might be able to offer better insight.

I am having a similar problem using the DLC-CPU on windows os! any updates would be great!