-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot register 2 metrics with same name #28
Comments
This reminds me of something. I encountered this issue in the early versions of otbtf. I did not really find the cause, but I did find a workaround at this time. OTB needs an environment variable for the applications path (i.e. the I think that this error happen in otbtf2.X. Can you confirm that? |
I just give a try inside the otbtf2.0 and I can't reproduce your issue.
What is the version used? |
I have tried this on otbtf1.7:gpu as well as otbtf2.0:gpu. This one works for me as well Can you try these.?
|
Damn, I can reproduce this bug. Indeed, in projects where I use both, I don't import tf and otb in the same |
According to this tensorflow issue, building TF using
The error message is now different... but it still doesn't work The following:
Throws:
And:
Results in:
|
any progress? I meet same error google-deepmind/reverb#24 |
Hi @lifeiteng , unfortunately not yet |
I have fixed it. Check the link options. |
Many thanks! I am not sure to fully understand your fix though... I don't see what you do with the |
I will push the code ASAP. |
@remicres @Pratyush1991 I found something interesting : I tried the test command : |
Yes, it is something like that. I guess that the c++ tensorflow classes used in otb applications "triggers" something that is done twice if we also |
The error looks the same but I don't think the problem is. I believe their issue was some executable in the project being linked to tensorflow while it wasn't required. I guess they fixed just by removing unnecessary links. |
It would probably require to modify the TF core in order to avoid re-loading the lib if it was already loaded by OTB in the same python thread... |
For now, we can't import both, but that's a bit sad. It is like you couldn't import |
I am reading this. Do we have a way to know which version of protobuf is used from the OTB applications, and from the |
I also saw it yesterday. In the beginning I thought that could be the problem, if OTB was already using another protobuf version (because of OpenCV may be ?). For the record TF2.4 is built with protobuf 3.14 |
May be tensorflow/tensorflow#22810 , they're talking about building plugins with libtensorflow_cc. |
I don't think that it is a limitation, but this would imply some cmake/c++ magic |
Do you think it could work ? There's probably no way to be sure without trying... Also yesterday I tried something : But regarding the docker build may be we can remove this target from BZL_TARGETS and use the one installed in site-packages/ since it seems it is built by default with the build_pip_package config. |
May be the problem is that you just can't import tensorflow C and C++ instances in the same python process ? |
The best "quick and dirty" fix for python scripts could imply |
@Pratyush1991 I don't know if that will help you a lot but in fact you can import both tensorflow and every otb applications + PatchesSelection, PatchesExtraction, LabelImageSampleSelection and DensePolygonClassStatistics in the same python script without the protobuf error. |
Nearly same issue here |
Wow, such a dead SO thread... |
This 3 years old issue will be fixed in the otbtf 4.0.0 release |
So..what kind of black magic did you invoke to make this work ? |
TBH I don't know if its the linking I did a bit differently, or moving to Tensorflow 2.12 |
closed with r4.0.0 |
Hello @remicres ,
I was trying to import OTB and TensorFlow via python. Looks like both cannot be imported or used at the same time either I have to use otb or TensorFlow separately. Is it because OTB uses the same library that is used by TensorFlow .?
As I understand I can create a separate python program to do tasks related to OTB and task related to TensorFlow and run them separately. Or should I import TensorFlow and call the OTB applications via the command line (os.subprocess).? (haven't tested this one tho)
Any suggestions.?
The text was updated successfully, but these errors were encountered: