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

Issue Title: Error Encountered: TypeError in grid_sample_gradfix.py #1

Open
fader2077 opened this issue May 15, 2024 · 1 comment
Open

Comments

@fader2077
Copy link

I encountered an error while running the script using the provided run_script.sh. Below is the traceback of the error:
And this is error

Traceback (most recent call last):
  File "/root/code/iiis508/Desktop/studiogan/NoisyTwins/src/main.py", line 196, in <module>
    loader.load_worker(local_rank=rank,
  File "/root/code/iiis508/Desktop/studiogan/NoisyTwins/src/loader.py", line 366, in load_worker
    gen_acml_loss = worker.train_generator(current_step=step)
  File "/root/code/iiis508/Desktop/studiogan/NoisyTwins/src/worker.py", line 702, in train_generator
    gen_acml_loss.backward()
  File "/opt/conda/lib/python3.10/site-packages/torch/_tensor.py", line 492, in backward
    torch.autograd.backward(
  File "/opt/conda/lib/python3.10/site-packages/torch/autograd/__init__.py", line 251, in backward
    Variable._execution_engine.run_backward(  # Calls into the C++ engine to run the backward pass
  File "/opt/conda/lib/python3.10/site-packages/torch/autograd/function.py", line 288, in apply
    return user_fn(self, *args)
  File "/root/code/iiis508/Desktop/studiogan/NoisyTwins/src/utils/style_ops/grid_sample_gradfix.py", line 52, in backward
    grad_input, grad_grid = _GridSample2dBackward.apply(grad_output, input, grid)
  File "/opt/conda/lib/python3.10/site-packages/torch/autograd/function.py", line 539, in apply
    return super().apply(*args, **kwargs)  # type: ignore[misc]
  File "/root/code/iiis508/Desktop/studiogan/NoisyTwins/src/utils/style_ops/grid_sample_gradfix.py", line 61, in forward
    grad_input, grad_grid = op(grad_output, input, grid, 0, 0, False)
TypeError: 'tuple' object is not callable

Steps to Reproduce:

Execute the script run_script.sh.
Observe the error mentioned above.

Expected Behavior:
The script should run without encountering any errors.

Additional Information:

This error seems to originate from grid_sample_gradfix.py at line 61.
The script is part of the NoisyTwins project.

Any assistance in debugging this issue would be greatly appreciated. Thank you!

@rangwani-harsh
Copy link
Contributor

Hi,

Please tell us which version of PyTorch you are using. I guess it might arise due to a version mismatch.

Can you try with Pytorch 1.13.1?

Thanks
Harsh

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