DLC live test - pose config file not found

Hi, just trying out installing dlc live and have had a couple of issues. The first was something to do with the tensorflow version (seems to be a common problem for me…) - see attached screenshot for error messages. I think I solved this by separately doing pip install tensorflow-gpu==1.13.1 after creating the environment (I understand up to tensorflow 2x is supported but this is the one in the example so I stuck with it). However I’ve also realised that the version of tensorflow used has to be the same as the exported model so this is still an issue I guess…

Screenshot 2021-03-13 202056|690x285

Then I tried dlc-live-test. It creates the temp directory and downloads the model but then can’t find the pose configuration file. I tried changing directories but that didn’t seem to help. Curl seems to be installed (curl -V gives 7.55.1). Below are the error messages. Thanks for any help!

(dlc-live) C:\WINDOWS\system32>dlc-live-test
c:\users\labadmin\anaconda3\envs\dlc-live\lib\site-packages\tensorflow\python\framework\dtypes.py:526: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_qint8 = np.dtype([(“qint8”, np.int8, 1)])
c:\users\labadmin\anaconda3\envs\dlc-live\lib\site-packages\tensorflow\python\framework\dtypes.py:527: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_quint8 = np.dtype([(“quint8”, np.uint8, 1)])
c:\users\labadmin\anaconda3\envs\dlc-live\lib\site-packages\tensorflow\python\framework\dtypes.py:528: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_qint16 = np.dtype([(“qint16”, np.int16, 1)])
c:\users\labadmin\anaconda3\envs\dlc-live\lib\site-packages\tensorflow\python\framework\dtypes.py:529: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_quint16 = np.dtype([(“quint16”, np.uint16, 1)])
c:\users\labadmin\anaconda3\envs\dlc-live\lib\site-packages\tensorflow\python\framework\dtypes.py:530: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
_np_qint32 = np.dtype([(“qint32”, np.int32, 1)])
c:\users\labadmin\anaconda3\envs\dlc-live\lib\site-packages\tensorflow\python\framework\dtypes.py:535: FutureWarning: Passing (type, 1) or ‘1type’ as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / ‘(1,)type’.
np_resource = np.dtype([(“resource”, np.ubyte, 1)])

Creating temporary directory…

Downloading full_dog model from the DeepLabCut Model Zoo…
% Total % Receivteadr :% EXrfreorrd o pAevneirnagg ea rScpheievde : FTaiimlee d t oT iompee n ’ \ \T.i\mtea p eC0u’
rrent
Dload Upload Total Spent Left Speed
0 174M 0 4108 0 0 4108 0 12:23:47 --:–:-- 12:23:47 66258
curl: (23) Failed writing body (2908 != 2920)

Running inference…

https://github.com/DeepLabCut/DeepLabCut-live/blob/c737e819bcbfd44c17b264652027c1a29e1aedf8/check_install/dog_clip.avi?raw=True\dog_clip.avi

Run 1 / 1

Traceback (most recent call last):
File “c:\users\labadmin\anaconda3\envs\dlc-live\lib\runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “c:\users\labadmin\anaconda3\envs\dlc-live\lib\runpy.py”, line 85, in run_code
exec(code, run_globals)
File "C:\Users\labadmin\anaconda3\envs\dlc-live\Scripts\dlc-live-test.exe_main
.py", line 7, in
File “c:\users\labadmin\anaconda3\envs\dlc-live\lib\site-packages\dlclive\check_install\check_install.py”, line 38, in main
benchmark_videos(model_dir, video_file, display=True, resize=0.5, pcutoff=0.25)
File “c:\users\labadmin\anaconda3\envs\dlc-live\lib\site-packages\dlclive\benchmark.py”, line 644, in benchmark_videos
output=output,
File “c:\users\labadmin\anaconda3\envs\dlc-live\lib\site-packages\dlclive\benchmark.py”, line 301, in benchmark
display_cmap=cmap,
File “c:\users\labadmin\anaconda3\envs\dlc-live\lib\site-packages\dlclive\dlclive.py”, line 150, in init
self.read_config()
File “c:\users\labadmin\anaconda3\envs\dlc-live\lib\site-packages\dlclive\dlclive.py”, line 164, in read_config
f"The pose configuration file for the exported model at {cfg_path} was not found. Please check the path to the exported model directory"
FileNotFoundError: The pose configuration file for the exported model at DLC_Dog_resnet_50_iteration-0_shuffle-0\pose_cfg.yaml was not found. Please check the path to the exported model directory

Hi @lauragrima, can you confirm the pretrained model is found in the folder? It looks like the download failed.

Thanks for helping @jeylau. This is probably a dumb question but I’m not even sure where I’m supposed to be looking - in the dlc-live environment that I’ve created? I also don’t know what the name of the file is for the pretrained model. I couldn’t find this info (just been following the instructions here: DeepLabCut-live/install_desktop.md at c737e819bcbfd44c17b264652027c1a29e1aedf8 · DeepLabCut/DeepLabCut-live · GitHub).

The folder is is called dlc-live-tmp and is created in your home directory. That’s where the pretrained model should normally be found :slight_smile:

if it did not download, it is because you don’t have admin rights. Please always open the terminal by right click _ “open as admin” and that will be solved :wink:

Thanks Mackenzie and Jessy! Mackenzie, I’m pretty sure I did open as admin (been messing around a lot with the terminal recently so it’s almost a force of habit at this point) but I’ll triple check I did so just to be sure.

Jessy, thanks for letting me know the folder and where to find it. Sorry for not getting back to you sooner, had some other pressures on my time, but I’ll try this tomorrow and will let you know how it goes or if I have any further issues.

Hi Jessy, just tried again (and definitely started the terminal as admin) - I can see the dlc-live-tmp folder in my home directory and it has an .avi file (dog_clip) but nothing else aside from that.

I’m sorry to pester but I’m still having the same issue. I’m sure it’s a very simple problem to solve but any help would be much appreciated, thanks.

Hi @lauragrima, here is a small piece of code borrowed from the way DeepLabCut downloads models; could you try it and let me know if it works for you?

import os
import urllib.request
import tarfile
from tqdm import tqdm

print("\nCreating temporary directory...\n")
home = os.path.expanduser("~")
tmp_dir = os.path.normpath(f"{home}/dlc-live-tmp")
os.makedirs(tmp_dir, exist_ok=True)
os.chdir(tmp_dir)

model_url = "http://deeplabcut.rowland.harvard.edu/models/DLC_Dog_resnet_50_iteration-0_shuffle-0.tar.gz"
response = urllib.request.urlopen(model_url)
total_size = int(response.getheader("Content-Length"))
pbar = tqdm(unit="B", total=total_size, position=0, unit_divisor=1024)

def show_progress(count, block_size, total_size): pbar.update(block_size)

filename, _ = urllib.request.urlretrieve(model_url, reporthook=show_progress)
with tarfile.open(filename, mode="r:gz") as tar:
    tar.extractall(tmp_dir)

Thanks Jessy. This code all ran fine and everything was extracted. (To be clear, I did this within the dlc-live environment).

Sweet! Happy to know it :slight_smile: