google-research / big_transfer

Official repository for the "Big Transfer (BiT): General Visual Representation Learning" paper.
https://arxiv.org/abs/1912.11370
Apache License 2.0
1.5k stars 175 forks source link

'StandardizedConv2D' object has no attribute '_convolution_op' #80

Open spradeep28 opened 1 year ago

spradeep28 commented 1 year ago

Trying to run bit_tf2.py training code..hitting below error when trying to run BiT-S training with below dataset

datasets, datasets_info = tfds.load('imagenette/160px', shuffle_files=True, as_supervised=True, with_info=True, read_config=tfds.ReadConfig(shuffle_seed=0))

python ./bit_tf2/basic_quantization.py --name quant --model BiT-M-R50x1 --logdir .

Pointers on what could be the issue...

Error Logs:

File "/home/psakhamo/opensource/big_transfer/big_transfer/./bit_tf2/basic_quantization.py", line 150, in main(parser.parse_args()) File "/home/psakhamo/opensource/big_transfer/big_transfer/./bit_tf2/basic_quantization.py", line 116, in main tf_model.build((None, None, None, 3)) File "/home/psakhamo/anaconda3/envs/BiTOV22.3/lib/python3.9/site-packages/keras/engine/training.py", line 513, in build self.call(x, **kwargs) File "/home/psakhamo/opensource/big_transfer/big_transfer/./bit_tf2/../bit_tf2/models.py", line 262, in call x = block(x) File "/home/psakhamo/anaconda3/envs/BiTOV22.3/lib/python3.9/site-packages/keras/utils/traceback_utils.py", line 70, in error_handler raise e.with_traceback(filtered_tb) from None File "/tmp/autograph_generated_filezfnshkiw.py", line 28, in tfcall x = ag.converted_call(ag__.ld(self)._unit_a_conv, (ag.ld(x),), None, fscope) File "/home/psakhamo/opensource/big_transfer/big_transfer/./bit_tf2/../bit_tf2/models.py", line 75, in build default_conv_op = self._convolution_op AttributeError: Exception encountered when calling layer 'unit01' (type BottleneckV2Unit).

in user code:

File "/home/psakhamo/opensource/big_transfer/big_transfer/./bit_tf2/../bit_tf2/models.py", line 172, in call  *
    x = self._unit_a_conv(x)
File "/home/psakhamo/anaconda3/envs/BiTOV22.3/lib/python3.9/site-packages/keras/utils/traceback_utils.py", line 70, in error_handler  **
    raise e.with_traceback(filtered_tb) from None
File "/home/psakhamo/opensource/big_transfer/big_transfer/./bit_tf2/../bit_tf2/models.py", line 75, in build
    default_conv_op = self._convolution_op

AttributeError: ### 'StandardizedConv2D' object has no attribute '_convolution_op'
psakamoori commented 1 year ago

The same issue seen with bit_tf2/train.py when ran with cifar10 dataset

psakamoori commented 1 year ago

Found the issue - Need to revert back to older tensorflow==2.2.0