How can I import resnet_rs module from keras?

Question:

I was trying to import resnet_rs module from keras. But counldn’t find a way to do it via keras.applications. Using tensorflow 2.8

I tried the following:

from tensorflow.keras.applications.resnet_rs import ResNetRS50

Got no module error.

Then I tried to use it via api, again got error

tf.keras.applications.resnet_rs.ResNetRS50(
    include_top=True,
    weights='imagenet',
    classes=1000,
    input_shape=None,
    input_tensor=None,
    pooling=None,
    classifier_activation='softmax',
    include_preprocessing=True
)

So, how can I import resnet_rs? (as we do for other resnet import) Any suggestions or pointers will be appreciated.

Asked By: Aurthur

||

Answers:

What version of Tensorflow are you on? I was on Tensorflow 2.8.2 and it wasn’t working for me either. I switched to 2.9.1, and it fixed the import. I think those modules were added only recently. That’s why previous versions won’t work.

To upgrade to the latest version:

pip install tensorflow --upgrade
Answered By: claudia

Checkout the official documentation here and it being used in a guide here

You can call it through the following –

tf.keras.applications.resnet.ResNet50
or
tf.keras.applications.ResNet50

Answered By: FoundABetterName
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.