Open folasefo opened 6 months ago
Hi there, I have a couple of questions for you, in order to better understand the issue: which version of python do you use? And which parameters did you change?
Hi there, I have a couple of questions for you, in order to better understand the issue: which version of python do you use? And which parameters did you change? First question Python 3.11.8
Second question In dataset.py:
change the batch_size from 144 to 64 in dataset.py
comment transforms.CenterCrop(148),
according to class OxfordPets(Dataset), I finish my dataset.
`class MyDataset(Dataset):
def init(self,
data_path: str,
split: str,
transform: Callable,
**kwargs):
self.data_dir = Path(data_path) / "/home/lulu/PyTorch-VAE/Data/bgs_image"
self.transforms = transform
imgs = sorted([f for f in self.data_dir.iterdir() if f.suffix == '.jpg'])
self.imgs = imgs[:int(len(imgs) * 0.75)] if split == "train" else imgs[int(len(imgs) * 0.75):]
def len(self): return len(self.imgs)
def getitem(self, idx): img = default_loader(self.imgs[idx])
if self.transforms is not None:
img = self.transforms(img)
return img, 0.0 # dummy datat to prevent breaking `
change patch_size: Union[int, Sequence[int]] = (64, 64),
from 256 to 64
In vae.yaml
`model_params: name: 'VanillaVAE' in_channels: 3 latent_dim: 3
data_params: data_path: "/home/lulu/PyTorch-VAE/Data/"
train_batch_size: 64 val_batch_size: 64 patch_size: 64 num_workers: 4
exp_params: LR: 0.005 weight_decay: 0.0 scheduler_gamma: 0.95 kld_weight: 0.00025d manual_seed: 1265
trainer_params: gpus: [1] max_epochs: 20
logging_params: save_dir: "logs/" name: "VanillaVAE"
` Thank you!
I think the issue is simply that there is an additionnal 'd' at the line "kld_weight" in the YAML file? Making it a string, hence difficult ot handle :)
I think the issue is simply that there is an additionnal 'd' at the line "kld_weight" in the YAML file? Making it a string, hence difficult ot handle :)
You Are Wonderful! This problem is solved. Thank you!
I think the issue is simply that there is an additionnal 'd' at the line "kld_weight" in the YAML file? Making it a string, hence difficult ot handle :)
And if I want to make the reconstruction sample better, can you give me some advice? My dataset is pictures of galaxies, I want to extract the geometry of these. Thanks again!
This is the question of all Machine Learning :D Be sure to test a few different hyperparameters, check that the validation loss decrease, and so on. As long as both train and val losses do not seem to be able to decrease anymore, it means that the model as achieve its best (with the chosen hyperparam). Otherwise, give the training a few more rounds :)
This is the question of all Machine Learning :D Be sure to test a few different hyperparameters, check that the validation loss decrease, and so on. As long as both train and val losses do not seem to be able to decrease anymore, it means that the model as achieve its best (with the chosen hyperparam). Otherwise, give the training a few more rounds :)
Okay, I will try it :) Thanks for your patience and help, have a nice day ;)
Can you train to achieve good results? I can't get good results with my own dataset
I think the issue is simply that there is an additionnal 'd' at the line "kld_weight" in the YAML file? Making it a string, hence difficult ot handle :)
And if I want to make the reconstruction sample better, can you give me some advice? My dataset is pictures of galaxies, I want to extract the geometry of these. Thanks again! Can you train to achieve good results? I can't get good results with my own dataset
Hi @sunny12345-bit , if you have some particular issue with the code, it would be best to open a dedicated issue :) It will help to help you!
Can you train to achieve good results? I can't get good results with my own dataset
Hmm, I have been busy with other assignments and haven't started to revise them :-( And I think my parameters are not suitable, the next step will look at the loss function and adjust parameters. Does the loss function decrease with each epoch of your data?
I think the issue is simply that there is an additionnal 'd' at the line "kld_weight" in the YAML file? Making it a string, hence difficult ot handle :)
And if I want to make the reconstruction sample better, can you give me some advice? My dataset is pictures of galaxies, I want to extract the geometry of these. Thanks again! Can you train to achieve good results? I can't get good results with my own dataset
Hi, my reconstruction results become better, do you get the good results?
嗨,我的重建效果变好了,你得到好的结果了吗?
May I ask which parameters you changed to achieve better results
嗨,我的重建效果变好了,你得到好的结果了吗?
May I ask which parameters you changed to achieve better results
I just have changed all parameters to the origin, and then changed the parameters of the image size to my data image size. And make sure your dataset and latent dim are big enough, or the model can't seize features.
Hi When I use my dataset (3,192,192), and I change some parameters,
According to debug, these value before)
kld_weight: 0.00025d
recons_loss: tensor(0.1564, device='cuda:1', grad_fn=)
loss = recons_loss + kld_weight * kld_loss
kld_loss: tensor(0.4086, device='cuda:1', grad_fn=If I set the kld_weight to 1, it worked, but it didn't work out so well: Sample:
Reconstruction:
One of my dataset:
The kld_weight=1 is okay? How to make the reconstruction and sample better? Thanks!