Code Monkey home page Code Monkey logo

Comments (4)

max-andr avatar max-andr commented on July 16, 2024

Hi,

Thanks for the interest in our paper!
It's a bit hard to tell what can be a problem here without having your version of the code. But I think you should just print logits_list and see why it's not possible to vertically concatenate it. Most likely, the model.predict() function in your version of the code returns something unexpected while it should return a matrix of logits of size number_of_samples x number_of_classes.

I hope that helps. Feel free to reopen the issue if there are more questions on this!

from square-attack.

Daizy97 avatar Daizy97 commented on July 16, 2024

Hi,

Thanks for the interest in our paper!
It's a bit hard to tell what can be a problem here without having your version of the code. But I think you should just print logits_list and see why it's not possible to vertically concatenate it. Most likely, the model.predict() function in your version of the code returns something unexpected while it should return a matrix of logits of size number_of_samples x number_of_classes.

I hope that helps. Feel free to reopen the issue if there are more questions on this!

Thanks for your valuable advice. It seems the problem comes from loading ImageNet. If possible, could you show me how your files arranged in this path IMAGENET_PATH = "/scratch/maksym/imagenet/val_orig" (Line 29, data.py)? Are val images and labels in the same directory?
My file is arranged like this:
image
But I found after loading the dataset, the y_test is all zeros.
Thanks very much for your help!

from square-attack.

max-andr avatar max-andr commented on July 16, 2024

Hi,

So in the directory IMAGENET_PATH = "/scratch/maksym/imagenet/val_orig", you should have folders named like n01440764, n01739381, n01978287, etc. In each folder there are images of a particular class.

For further details, you can check the documentation of ImageFolder:
https://pytorch.org/vision/0.8/datasets.html#imagefolder

I hope that helps!

from square-attack.

Daizy97 avatar Daizy97 commented on July 16, 2024

Hi,

So in the directory IMAGENET_PATH = "/scratch/maksym/imagenet/val_orig", you should have folders named like n01440764, n01739381, n01978287, etc. In each folder there are images of a particular class.

For further details, you can check the documentation of ImageFolder:
https://pytorch.org/vision/0.8/datasets.html#imagefolder

I hope that helps!

Thanks very much for your help!

from square-attack.

Related Issues (13)

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.