ain-soph / trojanzoo

TrojanZoo provides a universal pytorch platform to conduct security researches (especially backdoor attacks/defenses) of image classification in deep learning.
https://ain-soph.github.io/trojanzoo
GNU General Public License v3.0
274 stars 62 forks source link

RuntimeError: Dataset not found or corrupted. You can use download=True to download it #163

Closed ArshadIram closed 1 year ago

ArshadIram commented 1 year ago

The project is downloaded successfully.

git clone https://github.com/ain-soph/trojanzoo pip install -e trojanzoo

When I run this command:

python ./examples/train.py --color --verbose 1 --dataset cifar10 --model resnet18_comp --lr_scheduler --cutout --grad_clip 5.0 --save

I am getting this error message:

image

Why this import showing error: import trojanvision image

ain-soph commented 1 year ago

Please use --download to download the dataset.

For the import error, please check your linter message for more information.

ArshadIram commented 1 year ago

Now I am getting SSL error:

image File "C:\Users\irama\anaconda3\envs\security\lib\site-packages\torchvision\datasets\utils.py", line 94, in _get_redirect_url

ArshadIram commented 1 year ago

how can I install torjanvision? Do I need to install seperately or this comes with torjanzoo ?

ain-soph commented 1 year ago

Please check your pytorch version to make sure it's up to date.
You only need to install once with pip install -e trojanzoo after using git clone

ArshadIram commented 1 year ago

image Here is my pytorch version.

ain-soph commented 1 year ago

The error is not in TrojanZoo package.

Please check if the following torchvision command could be normally executed to download CIFAR10 dataset:
torchvision.datasets.CIFAR10(root='./', train=True, download=True)

Btw, if you want to do any training-related thing on CPU, please only consider MNIST dataset. CIFAR10 will be relatively slow on CPU.

ArshadIram commented 1 year ago

No I am getting this error now: urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:997)>

I just updated python and updated torch for this code. It was working before for other projects.

ain-soph commented 1 year ago

torchvision.datasets.CIFAR10(root='./', train=True, download=True) is related to torchvision package and not relying on trojanzoo package. Maybe you can raise an issue in their repo.

ArshadIram commented 1 year ago

I solved this issue. However, I am still getting an import error "import trojanvision"

ain-soph commented 1 year ago

You need to provide enough information for the import error.