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

consult #2

Open
Turningl opened this issue Apr 14, 2023 · 1 comment
Open

consult #2

Turningl opened this issue Apr 14, 2023 · 1 comment

Comments

@Turningl
Copy link

Turningl commented Apr 14, 2023

Hello professor:
when I run your code, I have some problem.

  Traceback (most recent call last):
    File "D:/Federated_learning/SpreadGNN_torch/utils/data_loader.py", line 216, in <module>
      load_data(args)
    File "D:/Federated_learning/SpreadGNN_torch/utils/data_loader.py", line 189, in load_data
      train_data_local_dict[client] = data.DataLoader(train_dataset_client, batch_size=1, shuffle=True,
    File "C:\miniconda\envs\pytorch-gpu\lib\site-packages\torch\utils\data\dataloader.py", line 353, in __init__
      sampler = RandomSampler(dataset, generator=generator)  # type: ignore[arg-type]
    File "C:\miniconda\envs\pytorch-gpu\lib\site-packages\torch\utils\data\sampler.py", line 107, in __init__
      raise ValueError("num_samples should be a positive integer "
  ValueError: num_samples should be a positive integer value, but got num_samples=0

image

It means when I use the function create_non_uniform_split(), client will get no dataset. So if this problem appears, the torch function DataLoader doesn't compile. How do you solve this problem?

@GG0614
Copy link

GG0614 commented Apr 23, 2023

Hello professor: when I run your code, I have some problem.

  Traceback (most recent call last):
    File "D:/Federated_learning/SpreadGNN_torch/utils/data_loader.py", line 216, in <module>
      load_data(args)
    File "D:/Federated_learning/SpreadGNN_torch/utils/data_loader.py", line 189, in load_data
      train_data_local_dict[client] = data.DataLoader(train_dataset_client, batch_size=1, shuffle=True,
    File "C:\miniconda\envs\pytorch-gpu\lib\site-packages\torch\utils\data\dataloader.py", line 353, in __init__
      sampler = RandomSampler(dataset, generator=generator)  # type: ignore[arg-type]
    File "C:\miniconda\envs\pytorch-gpu\lib\site-packages\torch\utils\data\sampler.py", line 107, in __init__
      raise ValueError("num_samples should be a positive integer "
  ValueError: num_samples should be a positive integer value, but got num_samples=0

image

It means when I use the function create_non_uniform_split(), client will get no dataset. So if this problem appears, the torch function DataLoader doesn't compile. How do you solve this problem?

How about now?

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

2 participants