Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About Test Dataset #4

Closed
ia-gu opened this issue Jun 2, 2022 · 6 comments
Closed

About Test Dataset #4

ia-gu opened this issue Jun 2, 2022 · 6 comments

Comments

@ia-gu
Copy link

ia-gu commented Jun 2, 2022

Hi,
I have a question about test in "main.py".

As I read your code, you use TRAIN dataset for test section(in main.py, line 44, 45)
Is there any reasons why you've done that?

thanks a lot in advance.

@johnsk95
Copy link
Owner

johnsk95 commented Jun 8, 2022

testset = Loader2(is_train=False, transform=transform_test)

If you are referring to this line, we are using the test dataset for the testset.

@johnsk95 johnsk95 closed this as completed Jun 8, 2022
@ia-gu
Copy link
Author

ia-gu commented Jun 8, 2022

However, you don't give path_list and then Loader2 return data in ('./DATA/train//').
There is no path for ('./DATA/test//') in Loader2, isn't it?

@seominseok0429
Copy link
Collaborator

seominseok0429 commented Jun 8, 2022

However, you don't give path_list and then Loader2 return data in ('./DATA/train//'). There is no path for ('./DATA/test//') in Loader2, isn't it?

import torch
import torchvision
from PIL import Image

class save_dataset(torch.utils.data.Dataset):

  def __init__(self, dataset):
    self.dataset = dataset

  def __getitem__(self, i):
      x, y = self.dataset[i]
      path = './DATA/test/'+str(y)+'/'+str(i)+'.png'
      x.save(path)


  def __len__(self):
    return len(self.dataset)

trainset = torchvision.datasets.CIFAR10(root='./data', train=True, download=True, transform=None)
#trainloader = torch.utils.data.DataLoader(trainset, batch_size=128, shuffle=True, num_workers=2)

testset = torchvision.datasets.CIFAR10(root='./data', train=False, download=True, transform=None)
#testloader = torch.utils.data.DataLoader(testset, batch_size=100, shuffle=False, num_workers=2)

dataset = save_dataset(testset)

for a, i in enumerate(dataset):
    dataset[a]

@ia-gu Save the data with the above code

@ia-gu
Copy link
Author

ia-gu commented Jun 8, 2022

@seominseok0429 Thanks, but I've already modify the code by myself.
I wanna know wether the authors used the original code on experiments for thesis they prposed.

@johnsk95
Copy link
Owner

johnsk95 commented Jun 8, 2022

Hello,
Yes, we used the exact code in this repository to produce the results in the paper.

@ia-gu
Copy link
Author

ia-gu commented Jun 8, 2022

I got it,
thanks for answering

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants