TL-System / plato

A federated learning framework to support scalable and reproducible research

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] URLError when running adaptive freezing example with CIFAR10 ResNet18

cuiboyuan opened this issue · comments

Describe the bug
An URLError (SSL: certificate verify failed) was raised when I tried to run the adaptive freezing example with CIFAR10 ResNet18

To Reproduce

  1. Change line 17 of file examples/adaptive_feeezing/adaptive_freezing.py to:
    os.environ['config_file'] = 'adaptive_freezing_CIFAR10_resnet18.yml'
  2. Ensure that this is the first time running this example; i.e., no content was downloaded and directory data/ and model/ have not been created yet under directory examples/adaptive_feeezing/
  3. Execute adaptive_freeezing.py
  4. Encounter URLError, SSL certificate verify failed, when the program attempts to download the dataset and model

Expected behavior
No error should be raised and the content should be downloaded successfully

OS environment (please complete the following information):

  • OS: Windows 10 64-bit
  • Using Python 3.9
  • Using IDE PyCharm Community Edition 2021.3

Additional context
Possible Solution:
I resolve the error by adding the code below to file plato/datasources/cifar10.py:

import ssl
ssl._create_default_https_context = ssl._create_unverified_context

I think the code bypasses the error by using the unverified SSL. I'm not sure whether that is a good solution.

This cannot be reproduced here as it can be related to issues on the client side when downloading from a HTTPS server. Closing.