qubvel / efficientnet

Implementation of EfficientNet model. Keras and TensorFlow Keras.
https://arxiv.org/abs/1905.11946
Apache License 2.0
2.07k stars 472 forks source link

'NoneType' object has no attribute 'image_data_format' #116

Open ggeo opened 4 years ago

ggeo commented 4 years ago

Hi, I am trying to run the code , I have tested with tensorflow 1.14.0 and 2.1 and I am receiving the same error.

`/opt/conda/lib/python3.7/site-packages/efficientnet/model.py in EfficientNet(width_coefficient, depth_coefficient, default_resolution, dropout_rate, drop_connect_rate, depth_divisor, blocks_args, model_name, include_top, weights, input_tensor, input_shape, pooling, classes, **kwargs)
    322                                       default_size=default_resolution,
    323                                       min_size=32,
--> 324                                       data_format=backend.image_data_format(),
    325                                       require_flatten=include_top,
    326                                       weights=weights)

AttributeError: 'NoneType' object has no attribute 'image_data_format'`
robin2897 commented 4 years ago

This happens to me as well in keras but I solved it by importing correct package from efficientnet import keras as eff_model