I am a 2nd-year Machine Learning Ph.D. student at Georgia Tech.
- 📙 Python/C++
- ⚓ Ph.D. student in ML
- ⚽ soccer Lover
- 🎮 LOL
[NeurIPS'2023] Official Code Repo:Diffusion-Based Adversarial Sample Generation for Improved Stealthiness and Controllability
norm_layer: list[Callable[..., nn.Module]],
TypeError: 'type' object is not subscriptable
There is an error when running attack_global.py:
Traceback (most recent call last):
File "code/attack_global.py", line 1, in
from load_dm import get_imagenet_dm_conf
File "/home/XXX/Diff-PGD/code/load_dm.py", line 23, in
from utils import *
File "/home/XXX/Diff-PGD/code/utils.py", line 4, in
from colorama import Fore, Back, Style
ModuleNotFoundError: No module named 'colorama'
I tried to install colorama using conda, however, another error occurred:
Traceback (most recent call last):
File "code/attack_global.py", line 8, in
from archs import get_archs, IMAGENET_MODEL
File "/home/XXX/Diff-PGD/code/archs.py", line 11, in
from robustbench.utils import load_model
File "/home/XXX/anaconda3/envs/diff-pgd/lib/python3.8/site-packages/robustbench/init.py", line 1, in
from .data import load_cifar10
File "/home/XXX/anaconda3/envs/diff-pgd/lib/python3.8/site-packages/robustbench/data.py", line 15, in
from robustbench.model_zoo import model_dicts as all_models
File "/home/XXX/anaconda3/envs/diff-pgd/lib/python3.8/site-packages/robustbench/model_zoo/init.py", line 1, in
from .models import model_dicts
File "/home/XXX/anaconda3/envs/diff-pgd/lib/python3.8/site-packages/robustbench/model_zoo/models.py", line 4, in
from robustbench.model_zoo.cifar10 import cifar_10_models
File "/home/XXX/anaconda3/envs/diff-pgd/lib/python3.8/site-packages/robustbench/model_zoo/cifar10.py", line 24, in
from robustbench.model_zoo.architectures.robustarch_wide_resnet import get_model as get_robustarch_model
File "/home/XXX/anaconda3/envs/diff-pgd/lib/python3.8/site-packages/robustbench/model_zoo/architectures/robustarch_wide_resnet.py", line 18, in
from torchvision.ops.misc import Conv2dNormActivation, SqueezeExcitation
ImportError: cannot import name 'Conv2dNormActivation' from 'torchvision.ops.misc' (/home/XXX/anaconda3/envs/diff-pgd/lib/python3.8/site-packages/torchvision/ops/misc.py)
Nice and interesting code! But how you generate an accurate mask corresponding to the image. Did you use code processing or some other tool like Photoshop? I don't see the part that generates the mask in your code, they seem to be part of the preprocessed ImageNet dataset. Sorry to bother you again. 👍
Thank you for open-sourcing your wonderful work. We would like to generate face adversarial examples using Diff-PGD. However, we can only find the checkpoint to generate ImageNet-like images. Could you provide the checkpoint to generate face images, or tell us how to train the model on the face dataset?
Very glad you shared your code! I'm sorry to bother you, but is the code incomplete, after I installed the corresponding environment as well as the data path, there is still a part of the unknown error, such as in the denoise.py
file from improved_diffusion.script_util import ...
this improved_diffusion
part and also the create_argparser()
in the same file, and InputCenterLayer()
in the dataset.py
doesn't seem to appear in the whole code. I run the code on my win10 system. I'm still a novice when it comes to coding, so if you know how to fix my problem I'd appreciate it! :)
Thank you for the great work you've done.
While assessing the effectiveness of Diff-PGD adversarial samples, I noticed that the ‘NormalizeLayer’ class in ‘dataset.py’ introduces an input normalization layer for all classifiers. The accompanying description states: "In order to certify radii in original coordinates rather than standardized coordinates, we add the Gaussian noise before standardizing, which is why we have standardization be the first layer of the classifier rather than as a part of preprocessing as is typical."
Currently, I am preparing to use Diff-PGD to test the robustness of a model that I have trained on ImageNet. However, I did not employ input normalization during the training of my model. I'm concerned that introducing it only during testing could introduce bias and might not fairly reflect the model's robustness.
Would omitting input normalization in the Diff-PGD data preparation adversely affect the results? Is it necessary to retrain my classifier with the input normalization step included for a fair and accurate evaluation?
Thank you for any guidance you can provide.
Great job. I have a question, the v2 version doesn't compute the gradient for the diffusion process, although it can be accelerated, is this still equivalent to the v1 version?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.