Giter Club home page Giter Club logo

hoangthang1607 / nfnets-tensorflow-2 Goto Github PK

View Code? Open in Web Editor NEW
30.0 5.0 12.0 164 KB

Pre-trained NFNets with 99% of the accuracy of the official paper "High-Performance Large-Scale Image Recognition Without Normalization".

Home Page: https://arxiv.org/abs/2102.06171

License: MIT License

Dockerfile 0.26% Python 28.76% Jupyter Notebook 70.98%
tensorflow2 keras pretrained-weights deepmind image-classification nfnets sgd-adc weight-standardization

nfnets-tensorflow-2's People

Contributors

hoangthang1607 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nfnets-tensorflow-2's Issues

Does not work with CPU: Grouped Convolution

Hey, first of all, thanks for your work - pretty fast :)

I just wanted to test your repository and noticed that the code fails for inference on CPU due to the grouped convolution.

Code:

model = NFNet(num_classes=1000, variant=variant)
model.build((None, 320, 320, 3))
model.load_weights(f"{variant}_NFNet/{variant}_NFNet")

test_image = tf.zeros(
    shape=(1, 320, 320, 3), dtype=tf.float32
)
model(test_image)

Error:
UnimplementedError: The Conv2D op currently does not support grouped convolutions on the CPU. A grouped convolution was attempted to be run because the input depth of 256 does not match the filter input depth of 128 [Op:Conv2D] (https://github.com/tensorflow/tensorflow/blob/669993ebe8534eac877eec61225925cff737eac2/tensorflow/core/kernels/conv_ops.cc#L160)

I already started debugging and as far as I see, the error occurs in the Second Block in conv1 when calling WSConv2D(). Here, the inputs are of shape (1, 68, 120, 256), while the weights are (3, 3, 128, 256).

I am not that familiar with grouped convolutions and NFNets in general. So I thought, you maybe already know how to solve the issue, if possible?

Edit:
Is it possible that the filters are already divided by the number of groups (in this case 2) and the inputs are not? See here

Running on your own data

Hi there,

I haven't tested this repo yet, but I presume it would be something along the lines of just respecifying the number of classes and images, as well as your directory to images? I've not seen the model up on Tensorflow Hub yet, any ideas would be great!

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.