tensorflow / models

Models and examples built with TensorFlow
Other
77.05k stars 45.77k forks source link

TF 2.0 already released, but the object detection models for training and detection is not updated yet? #7696

Open Bahramudin opened 5 years ago

Bahramudin commented 5 years ago

System information

Describe the problem

I want to ask that when the update will come for the object detection model, the present models (pre-trained models) are quite old and outdated, and almost all of them are more than one year which is not updated. Now I want to use TF 2.0 to train my own dataset by using one of the pre-trained models of the object detection model, but I don't want to use these old pre-trained models.

But when will the object detection model release the new pre-trained models for training and datasets, to get the advantage of the new TF release and API?

And if it is possible, then it will good to clean up the models for new libraries and codes. And delete all the deprecated and old models.

Thanks to the TF Team!

niderhoff commented 5 years ago

Hi @Bahramudin,

which models in particular are deprecated and old?

Bahramudin commented 5 years ago

Hi @niderhoff If you to model zoo then you will see almost all the pre-trained model are so old and belongs to older versions on the Tensorflow, and also I want to know how to use new version of the TF (2.0) to train my own dataset by using one of the pre-trained models of the model zoo. And what efficiency does the new TF version bring for us (accuracy and speed)? Before I was using TF 1.5-1.14 for training my own dataset and waiting a long time for TF 2.0 to come out and see brings what new functions and improvements. But the model zoo still seems so old.

DongChen06 commented 4 years ago

any solutions?

niderhoff commented 4 years ago

I wouldn't say all the models are outdated as, for example, MobileNet was updated 2 weeks ago (see Readme). Yes, some models are old, but I don't see how that is a problem since the architectures have not changed in the meantime. If there is a certain model architecture that is outdated, we should updated the code for that model. Only because they are based on TF1, doesn't mean they are mathematically wrong. So you could stick to that in the meantime if you need to get some results.

If you want to use TF2 that's fine, but I don't think it's officially supported for the object detection api (correct me if I'm wrong) and porting that would be a complex task.

Bahramudin commented 4 years ago

@niderhoff Thanks for the reply! I want to ask some questions:

  1. So it means that it is no matter in the pre-trained models by which TF version it was trained on?
  2. If I train my own dataset using one of the pre-trained models with TF1 and then with TF2 and then what is the difference between these two models (by considering speed, accuracy, ...)?
  3. Exactly what benefits do TF2 can give us while training the dataset? Or the benefits are when we running the model?

Thanks!

niderhoff commented 4 years ago
  1. no some models might be (upwards-)compatible but I guess most will not. Not unless you rename some functions in the source to something like tf.compat.v1.xxx
  2. the accuracy will most likely be identical. with regards to speed I would say it depends on if the optimizer or functions that the particular model uses have been improved wrt. speed in tf2. you could check the tf2 release notes for that and see if there are any general speed improvements or improvements to some functions that are used in the models you want to train.
  3. it is easier to use if you want to create your own models I guess. since Object Detection is a very high level API on top of tensorflow as is, I reckon there are no real improvements for the end user wrt. to usability just now.

also remember that the weights of models which are trained on tf1 might be easily usable in tf2 for (say inference).

bluewave8 commented 4 years ago

An example of an outdated is the cifar10 scripts in tutorials\image\cifar10

In particular cifar10_input

I've been trying to figure out how to rewrite for TF2.0, looks like specifically failure in 2.0 is due to tf.app and .flags but my experience hasn't been enough to help me succeed yet.

EDIT: I created another venv with TF 1.15, but still can't get the cifar10 tutorials to work:

AttributeError: module 'tensorflow.python.platform.flags' has no attribute 'FLAG'

Anku5hk commented 4 years ago

The problem was same with me, it is a mess some part of code is updated for TF2.0 and some part remains for TF1.* it isn't working anymore, i'll update if it works.

JFKS95 commented 4 years ago

I am having issues using TF2 when using the object_detection library to analyse my Yolov3 custom model. The scripts used for inference are not working and I believe it is because they use deprecated code.

zdzuni commented 4 years ago

I had same issue with tf.contrib.slim - contrib is deprecated in TF2.0 and I couldn't find alternative solution

~\Anaconda3\envs\tensorflow_gpu\lib\site-packages\object_detection\eval_util.py in 32 from object_detection.utils import visualization_utils as vis_utils 33 ---> 34 slim = tf.contrib.slim 35 36 # A dictionary of metric names to classes that implement the metric. The classes

AttributeError: module 'tensorflow' has no attribute 'contrib' ''' Any idea?