keras-squeezenet
keras-squeezenet copied to clipboard
how to solve"ImportError: cannot import name 'warnings' from 'keras.layers'"
Tensorflow Version
Please replace this line with Tensorflow version you are using.
Keras Version
Please replace this line with Keras version you are using.
Keras-squeezenet Version
Please replace this line with Keras-squeezenet version you are using.
Bug reports:
why always meet this problem when i am runing sequeezenet.can you give me some advices Please replace this line with a brief summary of your issue AND if reporting a build issue include the link from:
Code Sample:
Please replace this line with a code sample to replicate the issue.
I solved this error simply by commenting out the warnings section of the code. It just gives you statement printed if the program goes to that condition.
Commenting it out worked.
Tensorflow Version 2.6.0
Keras Version 2.6.0
Keras-squeezenet Version 0.4
Bug reports: why always meet this problem when i am runing sequeezenet.can you give me some advices: from keras.layers import Input, Convolution2D, MaxPooling2D, Activation, concatenate, Dropout, warnings ImportError: cannot import name 'warnings' from 'keras.layers' (C:\Users\Astha\miniconda3\envs\tf_2.4\lib\site-packages\keras\layers_init_.py)
Code Sample: Please replace this line with a code sample to replicate the issue. def get_model(): model = Sequential([ SqueezeNet(input_shape=(227, 227, 3), include_top=False), Dropout(0.5), Convolution2D(NUM_CLASSES, (1, 1), padding='valid'), Activation('relu'), GlobalAveragePooling2D(), Activation('softmax') ]) return model