ypeleg / nfnets-keras

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

'NFNet' object has no attribute 'variant' #10

Open sourabhyadav999 opened 3 years ago

sourabhyadav999 commented 3 years ago

Hello Sir,

I am trying to use NFNET model, but I am encountering, the aforementioned error. Code:

image

Error:

image

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

I believe The problem is in : https://github.com/ypeleg/nfnets-keras/blob/master/nfnets_keras/nfnet.py The above said line (line :: 89 block_params = self.variant_dict[self.variant]) should be after line 103(self.group_pattern = block_params.get('group_width', [128] * 4)). So the self.variant used in line 89 will be declared before it is used.

Thank you!

joonjeon commented 3 years ago

Hi!

As mentioned by @prateekkrjain in https://github.com/ypeleg/nfnets-keras/issues/1, this is an issue due to having parameter 'variant' used before assignment within the function definition. You can refer to the fixed rep here: https://github.com/prateekkrjain/nfnets-keras

maximus3219 commented 3 years ago

Hi!

As mentioned by @prateekkrjain in #1, this is an issue due to having parameter 'variant' used before assignment within the function definition. You can refer to the fixed rep here: https://github.com/prateekkrjain/nfnets-keras

How exactly can I use the fixed rep? I have already installed nfnets with "pip3 install nfnets-keras"

joonjeon commented 3 years ago

Hi! As mentioned by @prateekkrjain in #1, this is an issue due to having parameter 'variant' used before assignment within the function definition. You can refer to the fixed rep here: https://github.com/prateekkrjain/nfnets-keras

How exactly can I use the fixed rep? I have already installed nfnets with "pip3 install nfnets-keras"

Well, if that's the case, I recommend you remove the previously installed NFNets library by executing pip3 uninstall nfnets-keras After that, you can manually download the fixed repo at https://github.com/prateekkrjain/nfnets-keras, and install that repo for using NFNets.

silencessss commented 3 years ago

I have the some problem..

pratt3000 commented 3 years ago

@joonjeon I tried your solution, it still gives the same error

thusinh1969 commented 2 years ago

Buggy, untested release !

Steve