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

Windows support #21

Open
azoksky opened this issue Nov 23, 2022 · 0 comments
Open

Windows support #21

azoksky opened this issue Nov 23, 2022 · 0 comments

Comments

@azoksky
Copy link

azoksky commented Nov 23, 2022

Unfortunately, I am unable to run this on windows. When using torch==1.0.0 torchvision==0.2.1, faced c++ compliler issues. By using the latest conda version compatible with cuda 11.7, it worked and compilled pretty well. Then I fed the input images and it seemed to run well in the beginning. Then it complained of legacy autograd functions with correlation.py and I tried modifying the code by removing init() and adding @staticmethod along with apply() in the result. Now another error popped up. I am a newbie. Please help.

How can I resolve it?

Screenshot 2022-11-23 103010

Here is the modified correlation.py

class CorrelationFunction(torch.autograd.Function):

@staticmethod
def forward(ctx, input1, input2, 
        pad_size=3, kernel_size=3, max_displacement=20, stride1=1, stride2=2, corr_multiply=1):
    ctx.save_for_backward(input1, input2)

    with torch.cuda.device_of(input1):
        rbot1 = input1.new()
        rbot2 = input2.new()
        output = input1.new()
    return output

@staticmethod
def backward(ctx, grad_output):
    input1, input2 = ctx.saved_tensors

    with torch.cuda.device_of(input1):
        rbot1 = input1.new()
        rbot2 = input2.new()

        grad_input1 = input1.new()
        grad_input2 = input2.new()
    return grad_input1, grad_input2

class Correlation(torch.autograd.Function):

@staticmethod
def forward(ctx, input1, input2, 
        pad_size=0, kernel_size=0, max_displacement=0, stride1=1, stride2=2, corr_multiply=1): 
    result = CorrelationFunction.apply(input1, input2, pad_size, kernel_size, max_displacement, stride1, stride2, corr_multiply)
    return result
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

1 participant