Tensorflow with poets - python

I have questions to ask about why tensorflow with poets was not able to classify the image i want. I am using Ubuntu 14.04 with tensorflow installed using docker. Here is my story:
After a successful retrained on flower category following this link here. I wish to train on my own category as well, I have 10 classes of images and they are well organized according to the tutorial. My photos were also stored in the tf_files directory and following the guide i retrain the inception model on my category.
Everything on the retraining went well. However, as I tired to classify the image I want, I was unable to do so and I have this error. I also tried to look for py file in /usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/errors_impl.py but my dist-packages were empty! Can someone help me in this! Where can I find the py files? Thank you!

Your error indicates that it is unable to locate the file. I would suggest you to execute the following command in the directory where you have the graph and label files
python label_image.py exact_path_to_your_testimage_file.jpg

Related

Tensorflow Lite model always returns only 10 results

I'm running a simple TFLite cloud detection model for Coral trained with the help of a Jupyter notebook here. Though it never returns more than 10 outcomes, why is that? I don't see any limitation while training, is there a limitation by TFLite? For the actual run I use mostly the code here.
Even the testing set in the Jupyter notebook does not show more than 10 boxes. The dataset seems alright as when trained via Roboflow it returns hundreds of outcomes.
Thanks in advance, I have never trained AI models.
I tried checking the config files and looked on StackOverflow if anybody had had a similar problem, found nothing. Also the Jupyter notebook is no help.

Unable to get keras flow_from_directory to work with .gif data

I am trying to build an Image classifier with keras and tensorflow. However currently flow_from_directory does not see my images due to them being in .gif format (I checked this with .jpg and it works here). How can I fix this?
This old github page claims that I should be able to put .gif on my white_list_formats in the keras/preprocessing/image.py file. But after opening it there seems to be no white_list_formats in my version of image.py. Did keras change anything here?
I'm on Windows using anaconda3 distribution in case that matters.
Thanks for your help!
The github post you are referring to was posted for keras version 1.1.0. In the latest version they have removed that variable.
In the latest version of Keras, below formats are only supported.
PNG, JPG, BMP, PPM, TIF
Please refer to the this for documentation.
If you still want to try and edit white_list_format, please install keras 1.1.0 and try it.

Tensorflow Object Detection : Bounding box doesn't overlay on image

I am trying to run Tensorflow's Object Detection example(object_detection_tutorial.ipynb) as it is. But, at the end of the complete Jupyter notebook execution I don't see the bounding box.
I have followed instruction by running the following commands in the right paths-
protoc object_detection/protos/*.proto --python_out=.
export PYTHONPATH=$PYTHONPATH:`pwd`:`pwd`/slim
And even the model builder test runs successfully-
python object_detection/builders/model_builder_test.py
I have verified that the model has successfully downloaded. And even the images are in the right paths.
I don't see any errors in the console as well. Please can you tell me what am I doing wrong?
The current model listed by the master branch is unstable.
This is related to tensorflow/models issue 2773 and there is a fix for it.
In the "Variables" section of models/research/object_detection/object_detection_tutorial.ipynb you have to change the model.
Just replace the model name so the it looks like this
MODEL_NAME = 'ssd_mobilenet_v1_coco_11_06_2017'
and you will happily detect dogs and people and kites in no time :)

Tensorflow Retrain on Windows

When I follow the tutorials of "How to Retrain Inception's Final Layer for New Categories", I need to build the retainer like this
bazel build tensorflow/examples/image_retraining:retrain
However, my tensorflow on windows does not have such directory. I am wondering why and how can I solve the problem?
Thank you in advance
In my case tensorflow version is 1.2 and corresponding retrain.py is here.
Download and extract flowers images from here.
Now run the the retrain.py file as
python retrain.py --image_dir=path\to\dir\where\flowers\images\where\extracted --output_lables=retrained_labels.txt --output_graph=retrained_graph.pb
note: the last two arguments in the above command are optional.
Now to test the retrained model:
go the master branch and download the label_image.py code as shown below
Then run python label_image.py --image=image/path/to/test/classfication --graph=retrained_graph.pb --labels=retrained_labels.txt
The result will be like
From the screenshot, it appears that you have installed the TensorFlow PIP package, whereas the instructions in the image retraining tutorial assume that you have cloned the Git repository (and can use bazel to build TensorFlow).
However, fortunately the script (retrain.py) for image retraining is a simple Python script, which you can download and run without building anything. Simply download the copy of retrain.py from the branch of the TensorFlow repository that matches your installed package (e.g. if you've installed TensorFlow 0.12, you can download this version), and you should be able to run it by typing python retrain.py at the Command Prompt.
I had the same problem on windows. My windows could not find script.retrain. I downloaded retrain.py file from tensoflow website at here. Then, copied the file in the tensorflow folder and run the retrain script using Python command.

TensorFlow CIFAR-10: Location of Image data

I'm learning TensorFlow, running version r0.10 on Ubuntu 16.04. I am working on the CIFAR-10 Tutorial and have trained the CNN in the example.
Where is the image data stored for this tutorial?
The data path is defined on this line, in cifar10.py:
tf.app.flags.DEFINE_string('data_dir', '/tmp/cifar10_data',
"""Path to the CIFAR-10 data directory.""")
However I am confused as to why I cannot find this directory. I have attempted to manually search for it, and also look through all the example directories for it.
It is getting saved in a relative path for your OS, not your working directory. Take a look at my answer here and see if that helps.

Categories

Resources