Giter VIP home page Giter VIP logo

Comments (15)

HelenMao avatar HelenMao commented on July 1, 2024 1

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.

HelenMao avatar HelenMao commented on July 1, 2024 1

@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.

junyanz avatar junyanz commented on July 1, 2024

Could you report your PyTorch version? The current code only works well with PyTorch 0.1-0.3.

from bicyclegan.

rharadgithub avatar rharadgithub commented on July 1, 2024

@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.

HelenMao avatar HelenMao commented on July 1, 2024

I meet the same problems with @rharadgithub

from bicyclegan.

HelenMao avatar HelenMao commented on July 1, 2024

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.

rharadgithub avatar rharadgithub commented on July 1, 2024

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.

HelenMao avatar HelenMao commented on July 1, 2024

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.

rharadgithub avatar rharadgithub commented on July 1, 2024

@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.

twak avatar twak commented on July 1, 2024

I think I fixed it in this patch pull request #24

from bicyclegan.

junyanz avatar junyanz commented on July 1, 2024

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.

WorkingCC avatar WorkingCC commented on July 1, 2024

I have the same question as HelenMao. By the way, why is the batchsize set to two instead of one?
@junyanz

from bicyclegan.

rharadgithub avatar rharadgithub commented on July 1, 2024

Thanks to @junyanz

from bicyclegan.

junyanz avatar junyanz commented on July 1, 2024

@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.

WorkingCC avatar WorkingCC commented on July 1, 2024

@junyanz Thank you very much for your reply .

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.