Sxela / WarpFusion

WarpFusion
Other
964 stars 108 forks source link

Incorrect directory for raft half_jit.jit (0.10) #72

Closed ZachAR3 closed 1 year ago

ZachAR3 commented 1 year ago

When trying to run Generate optical flow and consistency maps I get an error about it being unable to find the raft_half.jit. This occurs because of the extra "/WarFusion/" in the beginning of the path in the script

        if flow_lq:
          raft_model = torch.jit.load(f'{root_dir}/WarpFusion/raft/raft_half.jit').eval()
        # raft_model = torch.nn.DataParallel(RAFT(args2))
        else: raft_model = torch.jit.load(f'{root_dir}/WarpFusion/raft/raft_fp32.jit').eval()
        # raft_model.load_state_dict(torch.load(f'{root_path}/RAFT/models/raft-things.pth'))
        # raft_model = raft_model.module.cuda().eval()

This can be solved by just changing the raft model from being either: raft_model = torch.jit.load(f'{root_dir}/WarpFusion/raft/raft_half.jit').eval() to raft_model = torch.jit.load(f'{root_dir}/raft/raft_half.jit').eval()

and in the else from: raft_model = torch.jit.load(f'{root_dir}/WarpFusion/raft/raft_fp32.jit').eval() to raft_model = torch.jit.load(f'{root_dir}/raft/raft_fp32.jit').eval()

I am unsure whether this is a local issue, or if this is an actual issue with the script. Since the .ipynb file doesn't exist in the main repo, only in the releases I can't make a PR.

Sxela commented 1 year ago

the 0.10 branch has an ipynb file attached so you can PR to it - https://github.com/Sxela/WarpFusion/tree/v0.10-AGPL

ZachAR3 commented 1 year ago

the 0.10 branch has an ipynb file attached so you can PR to it - https://github.com/Sxela/WarpFusion/tree/v0.10-AGPL

Ah MB i will make a pr when I get a chance then!

Sxela commented 1 year ago

I'm still a bit confused as if you make your env via provided *.bat or docker files, this repo gets cloned into the main warp project folder, thus the paths are correct

ZachAR3 commented 1 year ago

AH, a use case issue then. I cloned this repo and ran the prepare_env bat (well a shell adaptation for linux) from inside it. I will close the issue then since that's not an intended use case.

Sxela commented 1 year ago

Thank you anyway!