hii转换retrain图像分类器以用于tensorflow js的任何想法 从 https://www.tensorflow.org/hub/tutorials/image_retraining
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
尝试使用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
遇到此错误
"graph." % repr(name))
KeyError: "The name 'MobilenetV1/Predictions/Reshape_1' refers to an Operation not in the graph."
使用命令生成mobilenet v1模型也会失败
python retrain.py \
--image_dir ~/flower_photos \
--tfhub_module https://tfhub.dev/google/imagenet/mobilenet_v1_100_224/feature_vector/1
谢谢
答案 0 :(得分:0)
@Mustafa我认为您在--output_node_names ,
中尝试使用张量板查看模型时给出了错误的值,您将在此处找到必须提供的值,它应该类似于final_result(这是就我而言)。