ypeleg / nfnets-keras

Keras implementation of Normalizer-Free Networks and SGD - Adaptive Gradient Clipping
MIT License
68 stars 21 forks source link

AttributeError: 'NFNet' object has no attribute 'variant' #1

Closed pervin0527 closed 3 years ago

pervin0527 commented 3 years ago

Hi. I try to use nfnets, but I get the following error.

Error

AttributeError: 'NFNet' object has no attribute 'variant'

environment

code

from nfnets_keras import NFNetF3, SGD_AGC

model = NFNetF3(include_top=True, num_classes=10)
model.compile( SGD_AGC(lr=1e-3), loss='categorical_crossentropy' )
model.summary()    

How can i solve this Error?

hoangthang1607 commented 3 years ago

Hello. I think this code is copied from my own (link repo here) and the code built on pytorch here. I'm sure that the module SGD_AGC cannot work. In addition, I realized that I made a mistake in my code and he copied exactly the same mistake.

wajahat-iqbal commented 3 years ago

I am facing the same issue unable to run any of these ,Any solutions

king398 commented 3 years ago

Same issue

prateekkrjain commented 3 years ago

I am getting the same error!!

mohneesh7 commented 3 years ago

Getting the same error. TF 2.3 and TF2.4 cuDNN 8.0

prateekkrjain commented 3 years ago

I was able to solve this error - It was just because 'variant' was being used before the assignment. Here is the fixed repo. https://github.com/prateekkrjain/nfnets-keras

But, there are more issues.

pervin0527 commented 3 years ago

@prateekkrjain I went into the link you gave me and installed it. Installing with pypi causes the same issue. So, I tried using git clone, but there still seem to be a lot of other problems. I should just wait and use nfnets when it stabilizes.

hoangthang1607 commented 3 years ago

You should see my implementation here

joonjeon commented 3 years ago

Same issue here..