7

hii any idea to convert retrain image classifier for use with tensorflow js from 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

try to convert model using 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

getting this error

"graph." % repr(name))
KeyError: "The name 'MobilenetV1/Predictions/Reshape_1' refers to an Operation not in the graph."

also fail for mobilenet v1 model generate using command

python retrain.py \
    --image_dir ~/flower_photos \
    --tfhub_module https://tfhub.dev/google/imagenet/mobilenet_v1_100_224/feature_vector/1

thanks

Mustafa
  • 71
  • 3
  • [This Codelab](https://codelabs.developers.google.com/codelabs/tensorflowjs-teachablemachine-codelab/index.html#0) shows how to do it 100% in Tensorflow.js – mdaoust Jan 17 '20 at 14:28
  • is there any way to save existing classifier data and then train them. I saw some solutions but when train them data differ from live capture and give unexpected result. from this link https://github.com/tensorflow/tfjs/issues/633 and followed leung85 and oveddan 's approach but didn't get expected result. @mdaoust – Md. Jahidul Islam Jan 22 '20 at 16:50

1 Answers1

0

@Mustafa I think you're giving the wrong value in the --output_node_names , try going through the model using tensorboard and you will find the value what has to be given here, it should be something like final_result(this is in my case).

Mayur Karmur
  • 2,119
  • 14
  • 35