yu4u / age-gender-estimation

Keras implementation of a CNN network for age and gender estimation
MIT License
1.47k stars 503 forks source link

errors with keras image_dim_ordering() #102

Closed nyck33 closed 5 years ago

nyck33 commented 5 years ago

When I try to run the second cell in predict.ipynb I get:

/media/nobu/Ubuntu Backup1/1DeepLearning/2pixelation/age-gender-estimation/wide_resnet.py in __init__(self, image_size, depth, k)
     24         self._weight_init = "he_normal"
     25 
---> 26         if K.backend.image_data_format() == "th":
     27             logging.debug("image_dim_ordering = 'th'")
     28             self._channel_axis = 1

AttributeError: module 'keras.backend' has no attribute 'image_dim_ordering'

Tried changing to `K.backend.imaged_data_format()` but error stays the same.  
yu4u commented 5 years ago

What's the Keras and TensorFlow versions?

AlecVandenbroeck commented 5 years ago

I'm having the same issue. I think it's because I'm using Keras v2, where the function has been renamed to 'image_data_format()'. Not sure if @nyck33 made a spelling error (you wrote imaged instead of image) when commenting here or if he actually mistyped it.

AlecVandenbroeck commented 5 years ago

I've fixed it by switching to keras v2.2.4 instead of 2.2.5.

nyck33 commented 5 years ago

@AlecVandenbroeck I'll have to check that but thanks!

nyck33 commented 5 years ago

@yu4u

Changed line 26 of wide_resnet.py to if K.common.image_dim_ordering() == "th":
and it works.