Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dlc-live-test works on Linux only #51

Closed
eggplants opened this issue Aug 5, 2021 · 4 comments
Closed

dlc-live-test works on Linux only #51

eggplants opened this issue Aug 5, 2021 · 4 comments

Comments

@eggplants
Copy link
Contributor

On windows Powershell, tar.exe raises error tar.exe: Error opening archive: Failed to open '\\.\tape0'.

This kind of code is compatibile:

import os

os.system(f'curl -O "{model_url}"')
os.system(f'tar xzf "{url_basename}"')
os.system(f'rm "{url_basename}"')
@MMathisLab
Copy link
Member

HI @eggplants thanks! But I can confirm out code is used/tested on Windows10 (even in my own lab :). So curious more about what caused this error - can you elaborate on your setup/system?

@eggplants
Copy link
Contributor Author

eggplants commented Aug 5, 2021

tar.exe error has raised on the lab PC, Windows10 and Powershell 7.1.3 with Windows Terminal.
(I can't use the terminal in the lab right now, so I will post the log when I run it again later.)
On the other hand, dlc-live-test worked without error on my Ubuntu Desktop 21.04.
Also, Curl seems to be faster to download and save the file once than to pipe it through. (because of the buffering for the pipe?)

@AlexEMG
Copy link
Member

AlexEMG commented Oct 23, 2021

I suppose this depends on the terminal you use in Windows (probably you use gitbash, @MMathisLab). But I guess @eggplants's solution applies more broadly.

@sneakers-the-rat
Copy link
Collaborator

The most cross-platform thing to do would probably be to use python stdlib (urllib and tarfile) instead of relying on system libs (which, as you note, may or not be present on a given machine). I actually fixed this in #60 along with a few other quirks of the check_install.py script.

My approach was to do it like this (full code in PR):

# download dog test video from github:
print(f"Downloading Video to {video_file}")
url_link = "https://github.com/DeepLabCut/DeepLabCut-live/blob/master/check_install/dog_clip.avi?raw=True"
urllib.request.urlretrieve(url_link, video_file, reporthook=urllib_pbar)

# download exported dog model from DeepLabCut Model Zoo
if Path(model_tarball).exists():
    print('Tarball already downloaded, using cached version')
else:
    print("Downloading full_dog model from the DeepLabCut Model Zoo...")
    model_url = "http://deeplabcut.rowland.harvard.edu/models/DLC_Dog_resnet_50_iteration-0_shuffle-0.tar.gz"
    urllib.request.urlretrieve(model_url, str(model_tarball), reporthook=urllib_pbar)

print('Untarring compressed model')
model_file = tarfile.open(str(model_tarball))
model_file.extractall(str(model_dir.parent))
model_file.close()

Seems like this was closed, but it does seem like a compatibility issue since I imaging there will be lots of folks using default windows command prompt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants