ModuleNotFoundError:没有名为“classification_models.resnet”的模块

发布于 2025-01-20 19:17:51 字数 569 浏览 4 评论 0原文

from classification_models.resnet import ResNet18, preprocess_input
model = ResNet18((224, 224, 3), weights='imagenet')
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-43-ff8b34ae99fa> in <module>()
----> 1 from classification_models.resnet import ResNet18, preprocess_input
      2 
      3 model = ResNet18((224, 224, 3), weights='imagenet')

ModuleNotFoundError: No module named 'classification_models.resnet'

我无法在 google colab 上导入预训练的 ResNet18 模型。请帮忙

from classification_models.resnet import ResNet18, preprocess_input
model = ResNet18((224, 224, 3), weights='imagenet')
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-43-ff8b34ae99fa> in <module>()
----> 1 from classification_models.resnet import ResNet18, preprocess_input
      2 
      3 model = ResNet18((224, 224, 3), weights='imagenet')

ModuleNotFoundError: No module named 'classification_models.resnet'

I am not able to import pre-trained ResNet18 model on google colab. Please help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

枫林﹌晚霞¤ 2025-01-27 19:17:51

您可以访问所有ResNet (ResNet50, ResNet101, ResNet152) 模型及其 preprocess_input() 可以轻松地从tf.keras.applications API如下:

from tensorflow.keras.applications.resnet50 import ResNet50
from tensorflow.keras.applications.resnet50 import preprocess_input

请检查链接了解有关如何使用和应用ResNet模型的更多详细信息。

You can access all ResNet(ResNet50, ResNet101, ResNet152) models and its preprocess_input() easily from tf.keras.applications API as below:

from tensorflow.keras.applications.resnet50 import ResNet50
from tensorflow.keras.applications.resnet50 import preprocess_input

Please check this link for more details on how to use and apply ResNet model.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文