i am running FedLab/tutorials/readme_exp.ipynb Got this error
Opened this issue · 0 comments
Python version= 3.10.12
OS = Ubuntu
tourch version =2.4.0
Editor= Jupyter lab
Error
Training on client 71: 0%| | 0/1 [00:00<?, ?it/s]/home/ibad/FedLab/tutorials/../fedlab/contrib/dataset/partitioned_mnist.py:126: FutureWarning: You are using torch.load
with weights_only=False
(the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for weights_only
will be flipped to True
. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals
. We recommend you start setting weights_only=True
for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature.
dataset = torch.load(
Training on client 71: 0%| | 0/1 [00:00<?, ?it/s]
FileNotFoundError Traceback (most recent call last)
Cell In[9], line 13
10 broadcast = handler.downlink_package
12 # client side
---> 13 trainer.local_process(broadcast, sampled_clients)
14 uploads = trainer.uplink_package
16 # server side
File ~/FedLab/tutorials/../fedlab/contrib/algorithm/basic_client.py:139, in SGDSerialClientTrainer.local_process(self, payload, id_list)
137 for id in (progress_bar := tqdm(id_list)):
138 progress_bar.set_description(f"Training on client {id}", refresh=True)
--> 139 data_loader = self.dataset.get_dataloader(id, self.batch_size)
140 pack = self.train(model_parameters, data_loader)
141 self.cache.append(pack)
File ~/FedLab/tutorials/../fedlab/contrib/dataset/partitioned_mnist.py:138, in PartitionedMNIST.get_dataloader(self, cid, batch_size, type)
130 def get_dataloader(self, cid, batch_size=None, type="train"):
131 """Return dataload for client with client ID cid
.
132
133 Args:
(...)
136 type (str, optional): Dataset type, can be "train"
, "val"
or "test"
. Default as "train"
.
137 """
--> 138 dataset = self.get_dataset(cid, type)
139 batch_size = len(dataset) if batch_size is None else batch_size
140 data_loader = DataLoader(dataset, batch_size=batch_size)
File ~/FedLab/tutorials/../fedlab/contrib/dataset/partitioned_mnist.py:126, in PartitionedMNIST.get_dataset(self, cid, type)
116 def get_dataset(self, cid, type="train"):
117 """Load subdataset for client with client ID cid
from local file.
118
119 Args:
(...)
124 Dataset
125 """
--> 126 dataset = torch.load(
127 os.path.join(self.path, type, "data{}.pkl".format(cid)))
128 return dataset
File ~/new-env/lib/python3.10/site-packages/torch/serialization.py:1065, in load(f, map_location, pickle_module, weights_only, mmap, **pickle_load_args)
1062 if 'encoding' not in pickle_load_args.keys():
1063 pickle_load_args['encoding'] = 'utf-8'
-> 1065 with _open_file_like(f, 'rb') as opened_file:
1066 if _is_zipfile(opened_file):
1067 # The zipfile reader is going to advance the current file position.
1068 # If we want to actually tail call to torch.jit.load, we need to
1069 # reset back to the original position.
1070 orig_position = opened_file.tell()
File ~/new-env/lib/python3.10/site-packages/torch/serialization.py:468, in _open_file_like(name_or_buffer, mode)
466 def _open_file_like(name_or_buffer, mode):
467 if _is_path(name_or_buffer):
--> 468 return _open_file(name_or_buffer, mode)
469 else:
470 if 'w' in mode:
File ~/new-env/lib/python3.10/site-packages/torch/serialization.py:449, in _open_file.init(self, name, mode)
448 def init(self, name, mode):
--> 449 super().init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: '../datasets/mnist/fedmnist_iid/train/data71.pkl'