Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'keras.utils.generic_utils' has no attribute 'populate_dict_with_module_objects' #238

Open
giorgioberardini1 opened this issue Jan 18, 2022 · 0 comments

Comments

@giorgioberardini1
Copy link

Hello everyone, I'm running into this issue

def getGradCAM(X, model, resize_factor=0, layer_maps=-4):
    # Create functions ----------
    # GRAD - backprop
    # create function
    model = guided(model)
    saliency = K.gradients(K.sum(model.outputs[-1]), model.layers[layer_maps].output)
    pooled = K.mean(saliency[0], axis=range(len(saliency[0].shape) - 1))
    grad = K.function([model.layers[0].input], [pooled])

the problem is at the first line, here is the error:

Traceback (most recent call last):
File "/code/run_prediction.py", line 8, in
from attention_computation import getCAM, getGradCAM, getGradOrGuidedBackprop
File "/code/attention_computation.py", line 5, in
from vis.backprop_modifiers import guided
File "/usr/local/lib/python3.6/dist-packages/vis/backprop_modifiers.py", line 4, in
from . import backend
File "/usr/local/lib/python3.6/dist-packages/vis/backend/init.py", line 1, in
from keras import backend as K
File "/usr/local/lib/python3.6/dist-packages/keras/init.py", line 20, in
from . import initializers
File "/usr/local/lib/python3.6/dist-packages/keras/initializers/init.py", line 124, in
populate_deserializable_objects()
File "/usr/local/lib/python3.6/dist-packages/keras/initializers/init.py", line 82, in populate_deserializable_objects
generic_utils.populate_dict_with_module_objects(
AttributeError: module 'keras.utils.generic_utils' has no attribute 'populate_dict_with_module_objects'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant