Comments (6)
What is your error? Have you set --gpu_ids
?
from bicyclegan.
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.
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.
After reading pytorch docs i still don't know how to set the data to devices in BicycleGAN....
from bicyclegan.
Should
net = torch.nn.DataParallel(net, gpu_ids)
cooperate with any
data.to(device)?
from bicyclegan.
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)
- Apply BicycleGAN to improve poor line arts HOT 2
- Why we use 'retain_graph' when backwarding loss_G? HOT 2
- Question about PatchGAN perception field HOT 4
- Why my LPIPS distance is larger than what your paper say? HOT 3
- Question about conditional_D implementation HOT 3
- Not clear in the difference between the two latent spaces predicted HOT 5
- Test on single images HOT 1
- Compute graph wrong and one question HOT 4
- test_before_push is a great rapid test file, but seems outdated? HOT 3
- Metric reporting HOT 1
- Question about Encoder in cLR-GAN HOT 1
- Question about generating fake_B_random
- Question: Do you need two separate discriminators? HOT 2
- Incorrect discriminator update for opt.use_same_D HOT 1
- Regarding Training your Own Images HOT 4
- How to train on large images?
- Is there <pix2pix+noise> model code that can be directly run? HOT 1
- diversity question
- TypeError: __init__() got an unexpected keyword argument 'nl_layer'
- Regarding Latent Space Interpolation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bicyclegan.