Closed theangels closed 3 years ago
The current version of the object detection API requires Tensorflow 1.X (>1.12).Because the current version requires contrib.slim, which was removed in Tensorflow 2.0.
The current version of the object detection API requires Tensorflow 1.X (>1.12).Because the current version requires contrib.slim, which was removed in Tensorflow 2.0.
Is there any date or plan in the future to migrate it to 2.0?
I don't know the specific situation.But the object detection API will be updated to Tensorflow 2.0.
I don't know the specific situation.But the object detection API will be updated to Tensorflow 2.0.
Oh yeah! Thanks a lot.
@rootkitchao Any idea what the timeline for that is? Just curious, I know it will likely require a lot of work.
@rootkitchao Any idea what the timeline for that is? Just curious, I know it will likely require a lot of work.
did you find something? I cant use train.py, it still giving this error: "AttributeError: module 'tensorflow' has no attribute 'contrib' "
I tried to use model_main.py but nothing changes. I don't know what should I do
We are collaborating with TF team to migrate to 2.0 now, but this is a huge effort which may take months.
Any update on the actual status of migration to TF 2.0? Are there some particular actions/points that the community may be helpful?
@omerrciftcii I think your best option right now is to just create a virtual env with tensorflow 1.x
@pkulzc How's the progress going?
We've made some progress but are still not ready for full migration or release.
@pkulzc thank you for the update! Maybe some kind of work-around in the mean time?
while having tf 2.0.0: how to handle "module 'tensorflow' has no attribute 'GraphDef' "?
@pkulzc any updates on the migration status?
I used model_main.py in TF2.0 with the same problem.
Traceback (most recent call last):
File "model_main.py", line 26, in
I tried to use the tf_upgrade_v2 cmd to the eval_util.py and model_main.py its doesn't work. Although I know this behavior is not scientific. BTW, any update for object detection in TF2.0?
I used model_main.py in TF2.0 with the same problem. Traceback (most recent call last): File "model_main.py", line 26, in from object_detection import model_lib File "../object_detection/model_lib.py", line 27, in from object_detection import eval_util File "../object_detection/eval_util.py", line 40, in slim = tf.contrib.slim AttributeError: module 'tensorflow' has no attribute 'contrib'
I tried to use the tf_upgrade_v2 cmd to the eval_util.py and model_main.py its doesn't work. Although I know this behavior is not scientific. BTW, any update for object detection in TF2.0?
Until the Object Detection API is updated to TensorFlow 2 simply use TensorFlow 1.15 (pip install tensorflow==1.15
). It still contains contrib
and also a complete implementation of the 2.0 API. Using the compat.v2
module you can already ensure that your code (except for the Object Detection API part of course) will work with 2.0. Check the TensorFlow 1.15 release notes for further information.
hi, how's the progress going? Is it now possible to use Object Detection API with TF 2.0 ?
@jpacifico I guess it is already released... https://github.com/tensorflow/models/releases/tag/v2.0
Object Detection API is not yet released with TF 2.0 I guess
Object Detection API is not yet released with TF 2.0 I guess
yes I guess too, still have the same 'contrib' error with TF 2
As anyone knows any other ways to train the model with TF2.0 for now situation?
I tried it and it has the same contrib error. Did anyone get it up and running successfully?
Hey guys.. does anyone know if the object detection API was updated for TF2 and is working fine?
Hey @pkulzc
I see this issues is closed, is the Object Detection API already updated for TF2? Also wondering why this issues is closed, a ETA or update would be great.
Maybe create a milestone add there issues and PRs which gas to be done before TF2 compatible...
Is there any update? TF2.0 is still not working and getting the same "AttributeError: tf.contrib" error.
while having tf 2.0.0: how to handle "module 'tensorflow' has no attribute 'GraphDef' "?
@enyangxxx Currently tf 2.0.0 doesn't support graphdef model. You should either use keras model or saved model
is there any update on this issue? It's frustrating. The way I solved my problem was to use google colab, but training a model for long hours using on colab is a pain.
Please give us some update
is there any update on this issue? It's frustrating. The way I solved my problem was to use google colab, but training a model for long hours using on colab is a pain.
Please give us some update
@Masoud-Ghodrati Downgrade your tensorflow version to TF 1.x and try running the code. It may work
@all: I have tried a combination of Tensorflow 1.15 and Tensorflow models v1.13.0. And, both are working fine. Note that it is important you need to checkout v1.13.0 tag when you download models repo!
At the moment, Tensorflow model v2.0 is still not working.
yes still not working, frust
Looks like there has been some progress:
It would be actually really awesome to have an object detection API that is completely abstracted from the framework, such that you could use TF 1.x, TF 2.x, or even PyTorch or other framework to supply a model to use. The API shouldn't need to know that it's TensorFlow or some specific version under the hood; the model should be supplied with the relevant bindings to the specific framework and version that the model depends on.
It should in principle take only a simple line change of e.g.
from object_detection import ObjectDetector
model = ObjectDetector("/path/to/some_model_A_that_uses_tensorflow_1_13.model")
to
model = ObjectDetector("/path/to/some_model_B_that_uses_tensorflow_2_0.model")
or
model = ObjectDetector("/path/to/some_model_C_that_uses_pytorch.model")
to switch from one model to another. The .model file should be a tarball that is fully self-contained, including:
All this should be self-contained in that one file. This would make it as easy to share machine learning models as it is to share Android apps that are assembled into a single .apk file.
After this one line of code, all it should take to get inferences should be:
detections = model.detect([some_opencv_image, some_pil_image, "/path/to/some.jpg"])
and it should be able to deal with all of these common image types and run a batch inference.
Thoughts? I'd be willing to help build part of this if it's of interest and hasn't been done.
@dheera , we are building something close to what you stated above for Edge IoT computer vision: https://alwaysai.co/
Looks tike there has been some progress:
how? it works on colab but not locally? have you tried it locally?
@Masoud-Ghodrati , well, as you can see, it is 2.x with the object_detection api installed. It was also pushed a few days ago.
Nightly docker build is not working with it for me.
@Masoud-Ghodrati , well, as you can see, it is 2.x with the object_detection api installed. It was also pushed a few days ago.
Nightly docker build is not working with it for me.
Well, I installed the API on 16 Jan and didn't work on my local machine, the tutorial was TF 2.x. So, I can't see anything new.
I think the safest option will be to download to tensorflow 1.0. There's still no update for this. :/
Any updates?
Migrating to TF2 includes a number of critical issues:
Finally we have built a few TF2 models and are developing a few more latest models. The release will happen soon. Sorry for the long waiting!
What about fixing all the imports? On current master in 1.15 there are an abundance of warnings about deprecated names that really clog up the terminal and distract from valuable information. Will the Tensorflow 2.0 automatic converter be able to aid with this?
FYI, detected that version 2.2.0rc2 of tensorflow was released on PyPI at March 27, 2020
Hey guys, I am a bit confused ... This issue here on GitHub is closed, but I can't find any notes on an official release of the Object Detection API for TF2. What is the current status, can we use it with TF2 now? Thanks in advance.
@haimat No, scroll up you'll notice they closed it even though there is still no TF2 support.
That's why I am a bit confused. We use TF2 in our company, I can't change this. I was looking for something powerful as detector2 for PyTorch, which could be used on top of TF (but not TF1.x). Are there any plans for a release of this Object Detection API for TF2?
It’s definitely in progress but there’s a lot to do. I haven’t done it myself but your best bet is looking into the backwards compatibility stuff. It is my understanding that you can use tf 1 code in tf 2 using backwards compatible imports. There’s even an automatic conversion tool that will change your code to work with tf 2. I can’t say it’s easy since this repo is large, but that’s probably the simplest way to get things somewhat working in tf 2. It’s definitely better to rewrite things in the tf 2 style, but this might work as a short term fix. Let us know if you get things working!
Hmm... That's unfortunate. The detectron2 framework from Facebook looks really promising, I was hoping to find something similar for TF2. But if there is no such thing (yet), we might be tempted to switch to detectron2 and PyTorch.
Hi, any update for the tensorflow 2.0 object detection ? thanks
So, need how long we can use the TF2.0 object detection what do you guys think?
@pkulzc Thanks for keeping us updated. Is there an experimental Obj Det branch we can pull from before an official update is released?
System information
tf_upgrade_v2 --intree . --outtree . --copyotherfiles False
Describe the problem
I try to use ObjectDetection API in TensorFlow 2.0.0-alpha0, but the program told me that
AttributeError: module 'tensorflow' has no attribute 'contrib'
, clearly Google has delete the contrlib library. So next step I try to use thetf_upgrade_v2 utility
to help me converting existing TensorFlow 1.x Python scripts to TensorFlow 2.0. But finally I failed. Here are the message from terminal.Source code / logs
@wangtz