Backward compatibility for TensorflowModelServe
The new feature of !16 enables to simplify the use of TensorflowModelServe without setting the environment variable OTB_TF_NSOURCES
:
# Like this
serve = pyotb.TensorflowModelServe(n_sources=3)
# or like that:
serve = pyotb.TensorflowModelServe({'source1.il'=[...], 'source2.il'=[...], 'source3.il'=[...]})
However, this feature broke the previous behavior when the user sets the environment variable:
import os
os.environ['OTB_TF_NSOURCES'] = '3'
serve = pyotb.TensorflowModelServe()
serve.set_parameters({'source2.il': [...]})
raises:
Exception: TensorflowModelServe: parameter 'source2.il' was not recognized. Available keys are ('source1', 'source1.il', 'source1.rfieldx', 'source1.rfieldy', 'source1.placeholder', 'model', 'model.dir', 'model.userplaceholders', 'model.fullyconv', 'model.tagsets', 'output', 'output.spcscale', 'output.names', 'output.efieldx', 'output.efieldy', 'optim', 'optim.disabletiling', 'optim.tilesizex', 'optim.tilesizey', 'out')