facebookresearch / co-tracker

CoTracker is a model for tracking any point (pixel) on a video.
https://co-tracker.github.io/
Other
3.9k stars 251 forks source link

RuntimeError: Cannot find callable cotracker2v1 in hubconf #107

Open Fisher-Wang opened 1 month ago

Fisher-Wang commented 1 month ago

Thank you for the Cotrakcer v2.1 update!

However when I run the script in README, it run into error.

For offline mode:

Using cache found in /home/xxx/.cache/torch/hub/facebookresearch_co-tracker_main
Traceback (most recent call last):
  File "/home/xxx/cod/ego4d_process/src/third_party/co-tracker/quickstart2.py", line 15, in <module>
    cotracker = torch.hub.load("facebookresearch/co-tracker", "cotracker2v1").to(device)
  File "/home/xxx/miniforge3/envs/cotracker/lib/python3.10/site-packages/torch/hub.py", line 570, in load
    model = _load_local(repo_or_dir, model, *args, **kwargs)
  File "/home/xxx/miniforge3/envs/cotracker/lib/python3.10/site-packages/torch/hub.py", line 598, in _load_local
    entry = _load_entry_from_hubconf(hub_module, model)
  File "/home/xxx/miniforge3/envs/cotracker/lib/python3.10/site-packages/torch/hub.py", line 349, in _load_entry_from_hubconf
    raise RuntimeError(f'Cannot find callable {model} in hubconf')
RuntimeError: Cannot find callable cotracker2v1 in hubconf

For online mode:

Using cache found in /home/xxx/.cache/torch/hub/facebookresearch_co-tracker_main
Traceback (most recent call last):
  File "/home/xxx/cod/ego4d_process/src/third_party/co-tracker/online.py", line 14, in <module>
    cotracker = torch.hub.load("facebookresearch/co-tracker", "cotracker2v1_online").to(
  File "/home/xxx/miniforge3/envs/cotracker/lib/python3.10/site-packages/torch/hub.py", line 570, in load
    model = _load_local(repo_or_dir, model, *args, **kwargs)
  File "/home/xxx/miniforge3/envs/cotracker/lib/python3.10/site-packages/torch/hub.py", line 598, in _load_local
    entry = _load_entry_from_hubconf(hub_module, model)
  File "/home/xxx/miniforge3/envs/cotracker/lib/python3.10/site-packages/torch/hub.py", line 349, in _load_entry_from_hubconf
    raise RuntimeError(f'Cannot find callable {model} in hubconf')
RuntimeError: Cannot find callable cotracker2v1_online in hubconf
lvoursl commented 1 month ago

Hey @Fisher-Wang !

Just to confirm: have you cloned the latest version of the repo and getting this error?

As a first solution that comes to mind: it seems torch.hub has cached the previous version of the hubconf, so you have clean cache and try running demo again.

Just try: rm -rf /home/xxx/.cache/torch/hub/facebookresearch_co-tracker_main to clean cache and then run your code again. It should get fresh snapshot from the repo and download fresh models.

Let us know if it works!