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

Downloading dvt_detect_shots.pt error #35

Open
jdchart opened this issue Jun 23, 2023 · 2 comments
Open

Downloading dvt_detect_shots.pt error #35

jdchart opened this issue Jun 23, 2023 · 2 comments

Comments

@jdchart
Copy link

jdchart commented Jun 23, 2023

Hi there!

Great work on this, this is excellent.

Reporting an error that I did manage to fix on my own but thought you should be aware of.

Heads up: I'm running dvt as a git submodule which I then install into my virtual environment (which i suspect could be linked to the problem).

I was trying to run dvt.AnnoShotBreaks(), and dvt attempted to download this file : https://github.com/distant-viewing/dvt/releases/download/0.0.1/dvt_detect_shots.pt (I'm assuming a ML model?)

I was getting the following error:

Traceback (most recent call last):
  File "/Users/jacob/Documents/Git Repos/plozevet-archive/Scripts/DVT-Tests/breakpoint-test.py", line 23, in <module>
    process(params)
  File "/Users/jacob/Documents/Git Repos/plozevet-archive/Scripts/DVT-Tests/breakpoint-test.py", line 19, in process
    anno_breaks = dvt.AnnoShotBreaks()
  File "/Users/jacob/Documents/Git Repos/plozevet-archive/venv/lib/python3.10/site-packages/dvt/shots.py", line 26, in __init__
    model_path = _download_file("dvt_detect_shots.pt")
  File "/Users/jacob/Documents/Git Repos/plozevet-archive/venv/lib/python3.10/site-packages/dvt/utils.py", line 135, in _download_file
    download_url_to_file(url, cached_file, hash_prefix, progress=True)
  File "/Users/jacob/Documents/Git Repos/plozevet-archive/venv/lib/python3.10/site-packages/torch/hub.py", line 625, in download_url_to_file
    f = tempfile.NamedTemporaryFile(delete=False, dir=dst_dir)
  File "/usr/local/Cellar/[email protected]/3.10.12/Frameworks/Python.framework/Versions/3.10/lib/python3.10/tempfile.py", line 559, in NamedTemporaryFile
    file = _io.open(dir, mode, buffering=buffering,
  File "/usr/local/Cellar/[email protected]/3.10.12/Frameworks/Python.framework/Versions/3.10/lib/python3.10/tempfile.py", line 556, in opener
    fd, name = _mkstemp_inner(dir, prefix, suffix, flags, output_type)
  File "/usr/local/Cellar/[email protected]/3.10.12/Frameworks/Python.framework/Versions/3.10/lib/python3.10/tempfile.py", line 256, in _mkstemp_inner
    fd = _os.open(file, flags, 0o600)
FileNotFoundError: [Errno 2] No such file or directory: '/Users/jacob/.cache/torch/hub/checkpoints/tmps3k5bm1g'

In the end I went and manually created the path /torch/hub/checkpoints/. Sounds like a problem that could be easily resolved with a Path(dir).mkdir(parents=True) ? Or maybe the issue is my submodule/venv setup.

Anyway, all working my end and having fun with the toolkit!

@rlskoeser
Copy link
Contributor

I think this is the same problem as #34 and is resolved by the adjustment to download logic in #36 which has been merged to main

@jdchart
Copy link
Author

jdchart commented Jul 17, 2023

Hello ! Thanks, and sorry for the duplication!

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

No branches or pull requests

2 participants