python - 在 Windows 中的 Tensorflow 上加载经过训练的 ResNet 50 网络
问题描述
我最近开始研究深度学习。我需要在 Windows CPU 上运行使用 Tensorflow 加载的预训练 ResNet50 网络。我在网上的任何地方都找不到结构化的方法。有人可以帮我解决这个问题。
解决方案
您必须遵循 tensorflow 网站上的官方“如何进行迁移学习”教程。https://www.tensorflow.org/hub/tutorials/image_retraining
您必须更改的是retrain.py
第 1302 行,它将从 tensorflow-hub 加载预训练模型:
default=(
'https://tfhub.dev/google/imagenet/inception_v3/feature_vector/1'),
对此:
default=(
'https://tfhub.dev/google/imagenet/resnet_v1_50/feature_vector/1'),
或者您可以查看本网站上的其他预训练模型列表: https ://tfhub.dev/s?module-type=image-feature-vector
推荐阅读
- python - 如何用 Python 中的第 95 和第 5 个百分位替换异常值?
- dask - 使用 dask.array.store 到 hdf5 文件时,Dask 分布式 LocalCluster 失败并显示“TypeError:无法腌制 _thread._local 对象”
- html - 具有多个列表项的元素比具有单个列表项的元素推得更高
- c# - Azure DevOps:未找到带有 WikiHttpClient 的 Wiki 页面
- typescript - 反转必需和可选属性
- jquery - 如何在 laravel 的 jquery 中调用 ajax
- laravel - 批量更新多列时出错
- c++ - 使用指针将第一个(2D)数组的值复制到第二个的函数
- elasticsearch - simple_query_string 检查字段是否存在
- python - Python 全局变量名在函数内部被本地处理