Giter VIP home page Giter VIP logo

Comments (6)

junyanz avatar junyanz commented on July 19, 2024

What is your error? Have you set --gpu_ids?

from bicyclegan.

pipipopo avatar pipipopo commented on July 19, 2024

RuntimeError: Expected tensor for argument #1 'input' to have the same device as tensor for argument #2 'weight'; but device 1 does not equal 0 (while checking arguments for cudnn_convolution)
The error is above when I use config below:
GPU_ID=0,1
--gpu_ids ${GPU_ID}
--batchSize 4

from bicyclegan.

pipipopo avatar pipipopo commented on July 19, 2024

create web directory ../checkpoints/edges2shoes/edges2shoes_bicycle_gan/web...
Traceback (most recent call last):
File "./train.py", line 34, in
model.optimize_parameters()
File "../BicycleGAN-master/models/bicycle_gan_model.py", line 211, in optimize_parameters
self.update_G_and_E()
File "../BicycleGAN-master/models/bicycle_gan_model.py", line 199, in update_G_and_E
self.backward_EG()
File "../BicycleGAN-master/models/bicycle_gan_model.py", line 151, in backward_EG
self.loss_G_GAN = self.backward_G_GAN(self.fake_data_encoded, self.netD, self.opt.lambda_GAN)
File "../BicycleGAN-master/models/bicycle_gan_model.py", line 143, in backward_G_GAN
pred_fake = netD(fake)
File "../anaconda2/envs/xx/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "../anaconda2/envs/xx/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 114, in forward
outputs = self.parallel_apply(replicas, inputs, kwargs)
File "../anaconda2/envs/xx/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 124, in parallel_apply
return parallel_apply(replicas, inputs, kwargs, self.device_ids[:len(replicas)])
File "../anaconda2/envs/xx/lib/python3.6/site-packages/torch/nn/parallel/parallel_apply.py", line 65, in parallel_apply
raise output
File "../anaconda2/envs/xx/lib/python3.6/site-packages/torch/nn/parallel/parallel_apply.py", line 41, in _worker
output = module(*input, **kwargs)
File "../anaconda2/envs/xx/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "../BicycleGAN-master/models/networks.py", line 263, in forward
result.append(self.modeli)
File "../anaconda2/envs/xx/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "../anaconda2/envs/xx/lib/python3.6/site-packages/torch/nn/modules/container.py", line 91, in forward
input = module(input)
File "../anaconda2/envs/xx/lib/python3.6/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "../anaconda2/envs/xx/lib/python3.6/site-packages/torch/nn/modules/conv.py", line 301, in forward
self.padding, self.dilation, self.groups)
RuntimeError: Expected tensor for argument #1 'input' to have the same device as tensor for argument #2 'weight'; but device 1 does not equal 0 (while checking arguments for cudnn_convolution)

from bicyclegan.

pipipopo avatar pipipopo commented on July 19, 2024

After reading pytorch docs i still don't know how to set the data to devices in BicycleGAN....

from bicyclegan.

pipipopo avatar pipipopo commented on July 19, 2024

Should
net = torch.nn.DataParallel(net, gpu_ids)
cooperate with any
data.to(device)?

from bicyclegan.

junyanz avatar junyanz commented on July 19, 2024

I found the issue. If you set --netD basic_256 and --netD2 basic_256, it should work. It seems that the multi-GPU issue comes from multi-scale D (--netD basic_256_multi). I haven't had time to address the issue there. I also updated the code so that it is compatible with pix2pix/CycleGAN. You may want to check out the latest commit.

from bicyclegan.

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.