AttributeError: module 'tensorflow' has no attribute 'get_default_graph'

前端 未结 5 673
一生所求
一生所求 2021-01-05 11:26

I am doing some task related to image captioning and I have loaded the weights of inception model like this

model = InceptionV3(weights=\'imagenet\')
         


        
5条回答
  •  不知归路
    2021-01-05 11:48

    Another cause due to which this is happening is that in tensorflow_backend.py

    located in : lib/python3.6/site-packages/keras/backend/

    uses tf.compat.v1.get_default_graph for obtaining graph

    instead of tf.get_default_graph.

    By replacing this in the directory this problem can be solved successfully.

提交回复
热议问题