Code Monkey home page Code Monkey logo

Comments (3)

Normale avatar Normale commented on July 17, 2024 3

Might be wrong, but I had similar issue and solved it replacing this code:

        # DualStyleGAN\model\stylegan\non_leaking.py 
        # Line 360
        op = torch._C._jit_get_operation("aten::grid_sampler_2d_backward")
        grad_input, grad_grid = op(grad_output, input, grid, 0, 0, False)

with this one:

        output_mask = (ctx.needs_input_grad[1], ctx.needs_input_grad[2])
        op, _ = torch._C._jit_get_operation("aten::grid_sampler_2d_backward")
        grad_input, grad_grid = op(grad_output, input, grid, 0, 0, False, output_mask)

from dualstylegan.

williamyang1991 avatar williamyang1991 commented on July 17, 2024

I have no idea of this error.
For errors found in the code from DualStyleGAN/model/stylegan, I think you can try to directly pose issues in https://github.com/rosinality/stylegan2-pytorch for help.

from dualstylegan.

exceedzhang avatar exceedzhang commented on July 17, 2024

I have no idea of this error.
For errors found in the code from DualStyleGAN/model/stylegan, I think you can try to directly pose issues in https://github.com/rosinality/stylegan2-pytorch for help.

Can you give me some guidance when I encounter similar problems? thank you!@williamyang1991

python finetune_stylegan.py --iter 600 --batch 4 --size 1024 --ckpt ./checkpoint/stylegan2-ffhq-config-f.pt --style fantasy --augment ./data/fantasy/lmdb/

Load options
ada_every: 256
ada_length: 500000
ada_target: 0.6
augment: True
augment_p: 0
batch: 4
channel_multiplier: 2
ckpt: ./checkpoint/stylegan2-ffhq-config-f.pt
d_reg_every: 16
g_reg_every: 4
iter: 600
local_rank: 0
lr: 0.002
mixing: 0.9
model_path: ./checkpoint/
n_sample: 9
path: ./data/fantasy/lmdb/
path_batch_shrink: 2
path_regularize: 2
r1: 10
save_every: 10000
size: 1024
style: fantasy
wandb: False


load model: ./checkpoint/stylegan2-ffhq-config-f.pt
0%| | 0/600 [00:00<?, ?it/s]/root/DualStyleGAN/model/stylegan/op/conv2d_gradfix.py:88: UserWarning: conv2d_gradfix not supported on PyTorch 1.12.1. Falling back to torch.nn.functional.conv2d().
warnings.warn(
0%| | 0/600 [00:02<?, ?it/s]
Traceback (most recent call last):
File "finetune_stylegan.py", line 391, in
train(args, loader, generator, discriminator, g_optim, d_optim, g_ema, device)
File "finetune_stylegan.py", line 159, in train
r1_loss = d_r1_loss(real_pred, real_img)
File "/root/DualStyleGAN/util.py", line 71, in d_r1_loss
grad_real, = autograd.grad(
File "/opt/miniconda3/envs/vtoonify/lib/python3.8/site-packages/torch/autograd/init.py", line 276, in grad
return Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass
File "/opt/miniconda3/envs/vtoonify/lib/python3.8/site-packages/torch/autograd/function.py", line 253, in apply
return user_fn(self, *args)
File "/root/DualStyleGAN/model/stylegan/non_leaking.py", line 352, in backward
grad_input, grad_grid = GridSampleBackward.apply(grad_output, input, grid)
File "/root/DualStyleGAN/model/stylegan/non_leaking.py", line 361, in forward
grad_input, grad_grid = op(grad_output, input, grid, 0, 0, False)
TypeError: 'tuple' object is not callable

from dualstylegan.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.