FederatedAI / Practicing-Federated-Learning

Apache License 2.0
794 stars 245 forks source link

第三章的横向联邦图像分类报错OSError: [Errno 22] Invalid argument #7

Open code-X-HQM opened 2 years ago

code-X-HQM commented 2 years ago

Files already downloaded and verified Traceback (most recent call last): File "main.py", line 25, in server = Server(conf, eval_datasets) File "/Users/huqiming/Library/CloudStorage/OneDrive-stu.cdut.edu.cn/bs/Practicing-FL/Practicing-Federated-Learning-main/chapter03_Python_image_classification/server.py", line 11, in init self.global_model = models.get_model(self.conf["model_name"]) File "/Users/huqiming/Library/CloudStorage/OneDrive-stu.cdut.edu.cn/bs/Practicing-FL/Practicing-Federated-Learning-main/chapter03_Python_image_classification/models.py", line 7, in get_model model = models.resnet18(pretrained=pretrained) File "/Users/huqiming/opt/anaconda3/envs/py37/lib/python3.7/site-packages/torchvision/models/resnet.py", line 277, in resnet18 **kwargs) File "/Users/huqiming/opt/anaconda3/envs/py37/lib/python3.7/site-packages/torchvision/models/resnet.py", line 263, in _resnet progress=progress) File "/Users/huqiming/opt/anaconda3/envs/py37/lib/python3.7/site-packages/torch/hub.py", line 590, in load_state_dict_from_url return torch.load(cached_file, map_location=map_location) File "/Users/huqiming/opt/anaconda3/envs/py37/lib/python3.7/site-packages/torch/serialization.py", line 600, in load with _open_zipfile_reader(opened_file) as opened_zipfile: File "/Users/huqiming/opt/anaconda3/envs/py37/lib/python3.7/site-packages/torch/serialization.py", line 242, in init super(_open_zipfile_reader, self).init(torch._C.PyTorchFileReader(name_or_buffer)) OSError: [Errno 22] Invalid argument

环境: python3.7; torchaudio0.10.2; torchvision0.11.3

code-X-HQM commented 2 years ago

问题解决了,M1 pro的MAC不知道为什么用不了,换成Windows 10就可以了