Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • otbtf otbtf
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 6
    • Issues 6
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Cresson Remi
  • otbtfotbtf
  • Issues
  • #9
Closed
Open
Issue created Oct 28, 2021 by Narcon Nicolas@nicolas.narconDeveloper

Cannot mix OTBTF application and Tensorflow in Python

This piece of script raises an error on the last line

import tensorflow as tf
import otbApplication

# Create a dummy Tensorflow model and save it
x1 = tf.keras.Input(shape=[None, None, 4])  # [h, w, N]
x2 = tf.keras.Input(shape=[None, None, 4])  # [h, w, N]
y = tf.math.multiply(x1, x2)
model = tf.keras.Model(inputs=[x1, x2], outputs=y, name="multiply")
model.save("my_model_multiply")

# Create an OTB application
serve = otbApplication.Registry.CreateApplication('TensorflowModelServe')

Was run in 4 differents environments and raised different errors.

On mdl4eo/otbtf2.4:cpu and mdl4eo/otbtf2.4:gpu :

[libprotobuf ERROR external/com_google_protobuf/src/google/protobuf/descriptor_database.cc:118] File already exists in database: tensorflow/core/profiler/profiler_service_monitor_result.proto
[libprotobuf FATAL external/com_google_protobuf/src/google/protobuf/descriptor.cc:1379] CHECK failed: GeneratedDatabase()->Add(encoded_file_descriptor, size): 
Traceback (most recent call last):
  File "pyotb.py", line 12, in <module>
    serve = otbApplication.Registry.CreateApplication('TensorflowModelServe')

on mdl4eo/otbtf2.5:gpu and mdl4eo/otbtf2.5:cpu :

2021-10-28 13:31:51.933796: E tensorflow/core/lib/monitoring/collection_registry.cc:77] Cannot register 2 metrics with the same name: /tensorflow/core/op_expansion/node_counter
2021-10-28 13:31:51.933889: E tensorflow/core/lib/monitoring/collection_registry.cc:77] Cannot register 2 metrics with the same name: /tensorflow/core/op_expansion/graph_counter
2021-10-28 13:31:51.933922: E tensorflow/core/lib/monitoring/collection_registry.cc:77] Cannot register 2 metrics with the same name: /tensorflow/core/op_expansion/op_counter
2021-10-28 13:31:51.933988: F tensorflow/core/framework/device_factory.cc:90] Duplicate registration of device factory for type XLA_CPU with the same priority 50
Aborted (core dumped)
Edited Oct 28, 2021 by Narcon Nicolas
Assignee
Assign to
Time tracking