Skip to main content

Train Custom Image Classification Model using Google Inception API

The previous blog was shared with you on how to compile to use TensorFlow to classified Pre-trained images. Now I have tried to train custom images, and the results get look accurate!

1. Open Comand Prompt and then key in"git clone https://github.com/googlecodelabs/tensorflow-for-poets-2".
2. Create folder fruit inside"TensorFlow-for-poets-2\tf_files". Then create 2 different fruit folder, example:





3.  Now can download dataset by google Image durian and durian belanda, then save into the related folder,
3. Open Command Prompt inside this folder "TensorFlow-for-poets-2".
4. Then start train the data set by key in: python scripts/retrain.py --output_graph=tf_files/retrained_graph.pb --output_labels=tf_files/retrained_labels.txt --image_dir=tf_files/fruit.

5. After model train complete. Then we can start test to verify our train model. So download another Durian image then put input Image: C:\Users\csheng\tensorflow-for-poets-2\d1.jpeg

6. Enter command "python scripts/label_image.py --image d1.JPG" to start verify.
7. Output correct results Result! Done

Comments

Popular posts from this blog

Fixed issues:AttributeError: module 'tensorflow' has no attribute 'Session'

The previous blog, Train Custom Image Classification Model using Google Inception API was shared with you on how to train and prepare your data set. Some reader feedback that they are facing some issues with data set compilation. The issues mentioned were: AttributeError: module 'TensorFlow' has no attribute 'Session'. To fix these issues, you only need to reinstall tensorflow-gpu 1.15.0: pip3 install -- upgrade -- force - reinstall tensorflow - gpu == 1.15 . 0 more info: stack overflow hwerwerTrain Custom Image Classification Model using Google Inception API Train Custom Image Classification Model using Google Inception API

SmartSOS AI System

Abstract SmartSOS is an emergency AI handling system that works on Arduino Nano and Android mobile phones. In an emergency, the user(s) can trigger an emergency message by simply waving their hand. The emergency message (SMS) that send to related contacts consists of the user's contact number and location coordinates. Purpose Robbers and thieves can strike unexpectedly, and they can catch you off guard even if you already have an emergency plan in place. During a Robbery, you may have no time to pick up your phone to call for an emergency. Even there has some emergency app that integrates all the functionalities within one app with one action, but pickup phone and opening these apps will consume time hence will alert that the robbery's attention. SmartSOS AI System  With SmartSOS AI System, what to do during a Robbery? First, remain calm and simply raise up both hands. Then wave your hand left and right continues for more than 3sec, generally Wave Hand may likely draw the Robbe

Compile TensorFlow - Hello World

Previous tutorial was shared with you on how to setup tensorflow into your machine or PC. Now let us start test a simple tensorflow code to compile on our setup environment. 1. Open Comand Prompt on your PC. 2. Key in to conda info --envs verify tensorflow was installed on your PC. 3. Activated tensorflow , then let try to import tensorflow lib by key in import tensorflow as tf. 4. Now go to Anaconda> Sypder  editor , then key in the hello world code as below: 5. Then click to run the program, done! ** Note: You also can direct compile from Command prompt: python >>> import tensorflow as tf >>> hello = tf.constant('Hello, Tensorflow') >>> sess = tf.Session() >>> print(sess.run(hello))