nfnets-keras icon indicating copy to clipboard operation
nfnets-keras copied to clipboard

'NFNet' object has no attribute 'variant'

Open sourabhyadav999 opened this issue 3 years ago • 6 comments

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!

sourabhyadav999 avatar May 17 '21 06:05 sourabhyadav999

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

joonjeon avatar May 22 '21 07:05 joonjeon

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"

maximus3219 avatar Jun 04 '21 12:06 maximus3219

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.

joonjeon avatar Jun 07 '21 05:06 joonjeon

I have the some problem..

silencessss avatar Jun 11 '21 08:06 silencessss

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

pratt3000 avatar Jul 06 '21 11:07 pratt3000

Buggy, untested release !

Steve

thusinh1969 avatar Sep 21 '21 22:09 thusinh1969