Comments (15)
If you delete the L38 and L40 directly, the latter codes which use of these variables will be effected. And this is why it has arrtibuteError. @rharadgithub
I don't get the point why Junyan write the codes including the variable self.real_A_random. @junyanz
from bicyclegan.
@junyanz thanks for your replying, I am also wondering why in the unconditional D
self.real_data_random = self.real_B_random
why we need use self.real_B_random? I think it is another picture, why we need another picture in using the pair, self.real_A_encoded and self.real_B_encoded
@junyanz
from bicyclegan.
Could you report your PyTorch version? The current code only works well with PyTorch 0.1-0.3.
from bicyclegan.
@junyanz ,Dear
In [1]: import torch
In [2]: print(torch.version)
0.3.1.post2
I try
Firstly ,torch version=0.3.1.post2 with Anaconda3(python 3.6.4)
Secondly,torch version=0.2.0_1 with python 2.7.12
Thirdly,torch version=0.2.0_0 with anaconda2(python 2.7.14)
Fourthly,torch version=0.3.0.post4 with anaconda3(python 3.6.4)
But the problem remains same like before.
I am eagerly waiting for your reply.
Thank you.
from bicyclegan.
I meet the same problems with @rharadgithub
from bicyclegan.
Is the problem of the number of the datasets of edge2shoes
the number of trainsets in edge2shoes is 49825
however, the batch_size = 2
so the code in def forward
self.skip = self.opt.isTrain and self.input_A.size(0) < self.opt.batchSize if self.skip: print('skip this point data_size = %d' % self.input_A.size(0)) return
will return, so the bug is that there is no forward function. @rharadgithub
In fact the code
self.real_A_random = self.real_A[half_size:]
and
self.real_B_random = self.real_B[half_size:]
are not used at all
I suggest to delete the codes so that it will not be any bug when training the edge2shoes codes.
@junyanz
from bicyclegan.
Dear @HelenMao ,yes I am trying for datasets of edge2shoes. According to your suggestion,I just delete the L38 and L40 and run the scripts:bash ./scripts/train_edges2shoes.sh but still the following error
Traceback (most recent call last):
File "./train.py", line 27, in
model.update_D(data)
File "/home/hr/BicycleGAN/models/bicycle_gan_model.py", line 117, in update_D
self.forward()
File "/home/hr/BicycleGAN/models/bicycle_gan_model.py", line 45, in forward
self.z_random = self.get_z_random(self.real_A_random.size(0), self.opt.nz, 'gauss')
AttributeError: 'BiCycleGANModel' object has no attribute 'real_A_random'
On the other hand,When I just delete " self.skip = self.opt.isTrain and self.input_A.size(0) < self.opt.batchSize if self.skip: print('skip this point data_size = %d' % self.input_A.size(0)) return" keeping the L38 and L40 and run the scripts:bash ./scripts/train_edges2shoes.sh but still the following error:
Traceback (most recent call last):
File "./train.py", line 27, in
model.update_D(data)
File "/home/hr/BicycleGAN/models/bicycle_gan_model.py", line 119, in update_D
self.forward()
File "/home/hr/BicycleGAN/models/bicycle_gan_model.py", line 38, in forward
self.real_A_random=self.real_A[half_size:]
File "/home/hr/anaconda3/lib/python3.6/site-packages/torch/autograd/variable.py", line 78, in getitem
return Index.apply(self, key)
File "/home/hr/anaconda3/lib/python3.6/site-packages/torch/autograd/_functions/tensor.py", line 89, in forward
result = i.index(ctx.index)
ValueError: result of slicing is an empty tensor
Am I wrong with your suggestion?
from bicyclegan.
you can’ delete the L38 and L40 directly, the most convenient way is that you delete one image from train dataset from 49825 into 49824.
the number of the dataset should be even @rharadgithub
from bicyclegan.
@HelenMao ,I tried to train maps dataset,it has even number of samples and its working. But for odd number of samples,the problem remains(AttributeError: 'BiCycleGANModel' object has no attribute 'real_A_random') even after deleting L38 and L40.
from bicyclegan.
I think I fixed it in this patch pull request #24
from bicyclegan.
Thanks for the bug report. I think I fixed the issue with the latest commit. self.real_A_random is sometimes used in conditional D case. I refactored the code. self.real_A_random will not be used for unconditional D.
from bicyclegan.
I have the same question as HelenMao. By the way, why is the batchsize set to two instead of one?
@junyanz
from bicyclegan.
Thanks to @junyanz
from bicyclegan.
@HelenMao @WorkingCC Sorry for the late reply. This is a minor implementation detail that should not significantly affect the results. We chose to use different images for training cVAE-GAN and training cLR-GAN. That is also the reason for batchSize=2.
from bicyclegan.
@junyanz Thank you very much for your reply .
from bicyclegan.
Related Issues (20)
- Why does not large batch size like 128, 256 work well?
- Hi, please help me.
- Very Large Images
- 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.