你有什么想法可以转换重新训练图像分类器以与来自https://www.tensorflow.org/hub/tutorials/image_retraining 的tensorflow js 一起使用
mkdir ~/example_code
cd ~/example_code
curl -LO https://github.com/tensorflow/hub/raw/r0.1/examples/image_retraining/retrain.py
python retrain.py --image_dir ~/flower_photos
Run Code Online (Sandbox Code Playgroud)
尝试使用 tensorflowjs_converter https://github.com/tensorflow/tfjs-converter转换模型
tensorflowjs_converter \
--input_format=tf_frozen_model \
--output_node_names='MobilenetV1/Predictions/Reshape_1' \
--saved_model_tags=serve \
/tmp/output_graph.pb \
/tmp/web_model
Run Code Online (Sandbox Code Playgroud)
收到这个错误
"graph." % repr(name))
KeyError: "The name 'MobilenetV1/Predictions/Reshape_1' refers to an Operation not in the graph."
Run Code Online (Sandbox Code Playgroud)
使用命令生成 mobilenet v1 模型也失败
python retrain.py \
--image_dir ~/flower_photos \
--tfhub_module https://tfhub.dev/google/imagenet/mobilenet_v1_100_224/feature_vector/1
Run Code Online (Sandbox Code Playgroud)
谢谢
@Mustafa我认为你在尝试使用tensorboard遍历模型时给出了错误的值--output_node_names ,,你会发现这里必须给出的值,它应该类似于final_result(这是我的情况)。
| 归档时间: |
|
| 查看次数: |
542 次 |
| 最近记录: |