Tal Shaul
Tal Shaul

Reputation: 21

AttributeError: module 'keras.applications' has no attribute 'VGG16'

I'm trying to run code that is supposed to identify different types of image categories. The code is of VGG16 and I have the following error. Of course I tried to install and import directories (keras etc...)and the error still exists. Would appreciate help. Thanks.

This is the line of code that is marked

vgg16 = applications.VGG16(include_top=False, weights='data3/')

And that's the error

AttributeError: module 'keras.applications' has no attribute 'VGG16'

Upvotes: 2

Views: 7512

Answers (3)

Syed Zoheab
Syed Zoheab

Reputation: 1

from tensorflow import keras as K., along with 
from tensorflow.keras import applications

This can also help.

Upvotes: 0

ant0nk
ant0nk

Reputation: 144

I solved same issue with from tensorflow.keras import applications instead of from keras import applications

Upvotes: 1

user1635327
user1635327

Reputation: 1641

It should be applications.vgg16.VGG16(...).

Upvotes: 2

Related Questions