Coder Social home page Coder Social logo

certify error about dmae HOT 6 CLOSED

yuchongy1 avatar yuchongy1 commented on July 23, 2024
certify error

from dmae.

Comments (6)

quanlin-wu avatar quanlin-wu commented on July 23, 2024

Sorry to answer your question so late. You said that the bug happend when you run certify_cifar10.py. In fact, 768 is the embedding dimension of ViT Base, I think the problem should lies in 'models_vit.py', likely to be the nn.LayerNorm. You need to check the version of 'timm', our version is 0.5.4.

from dmae.

yuchongy1 avatar yuchongy1 commented on July 23, 2024

Hi,

Thanks for your reply.

I believe I have

assert timm.__version__ == "0.5.4"  # version check

in my code, which ensures the correct version?

from dmae.

quanlin-wu avatar quanlin-wu commented on July 23, 2024

Can you print the shape of tensor in 'models_vit.py'?
I want to know whether the bug happen before
'''
for blk in self.blocks:
x = blk(x)
'''
or not.

from dmae.

yuchongy1 avatar yuchongy1 commented on July 23, 2024

Sorry, I think I have the version check in the main but not in the models_vit.py,
but I suppose the check in the main.py should already ensure the timm is 0.5.4 for models_vit.py?

I put the print statement in Smooth.py, "_sample_noise" function,
just feeding "noisy" into self.base_classifier.

from dmae.

quanlin-wu avatar quanlin-wu commented on July 23, 2024

The bug happened when you want to evaluate the model on cifar10. Did
you run the pre-training or fine-tuning successfullly? If you directly run 'certfy_cifar10.py', the assert code may not take effect.
The shape of 'nosiy' is correct. It seems the problem lies in the norm layers in the model (the base classifier). Checking the shape of tensors in the vit model may help.

from dmae.

yuchongy1 avatar yuchongy1 commented on July 23, 2024

The pre-training and finetuning can run without errors. I will check the shape in vit.

from dmae.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.