Loading two different Tensorflow versions with different classloaders
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Java
- Sterne
- 928
- Forks
- 227
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Hello, I am creating a program that makes inference with already trained models and I want to allow changing the tensorflow versions on runtime. For that I am loading dynamically the JARS needed to run Inference with TF Java in a separate classloader. These JARs are not in the classpath of the main program. I expected that when the ClassLoader is garbage collected, the native libraries loaded by that classloader were going to be unloaded too. However that is not the case and I am not able to load two different versions of Tensorflow in the same run time one after the other. The error I get when I try to execute a command with the JARs corresponding to the second TF version loaded is :
2021-12-21 14:47:11.121313: F external/org_tensorflow/tensorflow/core/framework/variant_op_registry.cc:46] Check failed: existing == nullptr (0x7ff35a2acc38 vs. nullptr)Unary VariantDecodeFn for type_name: tensorflow::data::WrappedDatasetVariant already registered
Is this behaviour expected? Is there any way I can do what I want?
regards,
Carlos
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Das Issue nennt keine Repository-Datei, keinen Test und keinen Einstiegspunkt. Beginne damit, das Laden nativer Bibliotheken und die Classloader-Handhabung von TensorFlow Java nachzuverfolgen, und reproduziere anschließend das sequentielle Laden zweier TensorFlow-Versionen unter Verwendung des gemeldeten variant-op-Registrierungsfehlers. Als erledigt gilt die Dokumentation, ob das Entladen unterstützt wird, sowie die Identifizierung einer validierten Möglichkeit, Versionen getrennt zu laden, falls es eine gibt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java, tensorflow
- Bereich
- machine-learning
- Issue-Typ
- Bug
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100