Git Product home page Git Product logo

tfclassifier's Introduction

tfClassifier

This repository contains code to:

  1. setup the tensorflow imagenet classifier which is capable of identifying 1000 objects.
  2. setup a retraining script that takes in your own images and trains a new mdoel that you can use.
  3. Using tensorflow to build a text classification system.

setting up tensorflow classifier and retraining it

find the tutorials here:

  1. https://sourcedexter.com/quickly-setup-tensorflow-image-recognition/
  2. https://sourcedexter.com/retrain-tensorflow-inception-model/
  3. https://sourcedexter.com/tensorflow-text-classification

tfclassifier's People

Contributors

akshaytc avatar diogobernini avatar sourcedexter avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tfclassifier's Issues

Costly algorithms are computationally inefficient at all

Hello there,

I admire your work and it took me some time to wrap my head around your [algorithm] (https://github.com/sourcedexter/tfClassifier/blob/master/text_classification/classify_text.py) 2nd loop to be particular.

The two nested loops I've found very costly, I haven't calculated the complexity but it seems that it might reach O(N^2) at times. I have 300k rows of data with text cells that represent "descriptions of certain categories" more than 50 words, so I am looking for approaches to manufacture a bag of words in a much smaller amount of time.

Thanks!

Reusing the Model

What happens when you train the model in one file and try to use it from another in another time. looks like the code needs the variable "words" created in the nested loop to predict the class.

returning json so not able to mapped the image

When I have exported it to tensorflow serving, it is deployed and ready to server.
But when we are consuming that service through one python client, it is returning ('Result is: ', outputs {
key: "prediction"
value {
dtype: DT_FLOAT
tensor_shape {
dim {
size: 1
}
dim {
size: 2048
}
}
float_val: 0.317088961601
float_val: 0.0552041605115
float_val: 0.778943479061
float_val: 0.340197831392
float_val: 0.0894310623407
}
I'm not able figure it out, what was the issue. I'm expecting result like /label_image.py.
Could you please guide me on this.
Thanks

Re-use for inference a trained from scratch model

Hi and thanks for sharing this. I have retrained a new model instance with a new set of images (5 classes). Any advice on how can be used to predict/make inference on my test set images ? i.e. is there a way for the script retrain_model_classifier.py to accept a whole directory of images ?

Also what modifications do we need to make to save the retrained model as .h5 at the end of the training?

Thank you in advance

Error on Retraining

I'm following the documentation on https://sourcedexter.com/retrain-tensorflow-inception-model/ but I keep running into an error on retraining.

The tensor <tf.Tensor 'pool_3/_reshape:0' shape=(1, 2048) dtype=float32> cannot be accessed from here, because it was defined in <tensorflow.python.framework.ops.Graph object at 0x000001A3E4EAC648>, which is out of scope.

Any idea on how to deal with this?

Version incompatibilities

Can you please tell me the versions used..
I am facing many incompatibilities
Using tensorflow version 1.13.1
can u guide with version of
tensorflow and tflearn

encountered problems when running your model, pls help

Hi There,

I use the following for training, it works well:
python retrain_new.py --image_dir ./DataSet --output_graph ./output_dir/output_graph.pb --output_labels ./output_dir/output_labels.txt --summaries_dir ./output_dir/retrain_logs --how_many_training_steps 600 --learning_rate 0.01 --testing_percentage 10 --validation_percentage 10 --model_dir ./inception --bottleneck_dir ./output_dir

When I run the following to do the classfiying test:
python retrain_model_classifier.py ./test_img/2222.jpg

It raise the following error:
Traceback (most recent call last): File "retrain_model_classifier.py", line 12, in <module> in tf.gfile.GFile("./labels.txt")] File "retrain_model_classifier.py", line 11, in <listcomp> label_lines = [line.rstrip() for line File "D:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 220, in __next__ return self.next() File "D:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 214, in next retval = self.readline() File "D:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 183, in readline self._preread_check() File "D:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\lib\io\file_io.py", line 85, in _preread_check compat.as_bytes(self.__name), 1024 * 512, status) File "D:\ProgramData\Anaconda3\envs\tensorflow\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 519, in __exit__ c_api.TF_GetCode(self.status.status)) tensorflow.python.framework.errors_impl.NotFoundError: NewRandomAccessFile failed to Create/Open: ./labels.txt : ϵͳ\udcd5Ҳ\udcbb\udcb5\udcbdָ\udcb6\udca8\udcb5\udcc4\udcceļ\udcfe\udca1\udca3 ; No such file or directory

I guess I missed some arguments when running retrain_model_classifier.py

Can you pls help on this?

How to load and restore this model

Hii,

I was able to use this code for my project and it turned out to be very useful.
Thanks a ton.

However, I wanted to know how to load and restore this DNN model. Tried a lot of other methods but none worked.
Could you kindly help as I wanted to deploy it as early as possible.

How to classify a large number of images?

Sir,I have trained a model on my own data which is for flower classification,and it has three classes, that is azalea,tulip and lily,and now I want to use the model to classify them,so How to use the model to classify the data,the speed I need is about 100fps,and the model I use is mobilenet,and I have tried to modify the code in tensorflow :tensorflow/tensorflow/examples/label_image/label_image.py,but I failed,could you please help me?

any idea on the tf version?

As we known, the tensorflow changed quiet greatly between different version.

Can you pls tell which version I need to choose to run this model(images classifier)?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.