diff --git a/DQM/DTMonitorClient/src/DTOccupancyTestML.cc b/DQM/DTMonitorClient/src/DTOccupancyTestML.cc index 87c5d4b13950a..949082017238c 100644 --- a/DQM/DTMonitorClient/src/DTOccupancyTestML.cc +++ b/DQM/DTMonitorClient/src/DTOccupancyTestML.cc @@ -125,7 +125,6 @@ void DTOccupancyTestML::dqmEndLuminosityBlock(DQMStore::IBooker& ibooker, vector chambers = muonGeom->chambers(); // Load graph - tensorflow::setLogging("3"); edm::FileInPath modelFilePath("DQM/DTMonitorClient/data/occupancy_cnn_v1.pb"); tensorflow::GraphDef* graphDef = tensorflow::loadGraphDef(modelFilePath.fullPath()); diff --git a/L1Trigger/L1CaloTrigger/plugins/L1NNCaloTauEmulator.cc b/L1Trigger/L1CaloTrigger/plugins/L1NNCaloTauEmulator.cc index 52bd6c1cb3ec6..c6ee3d9135617 100644 --- a/L1Trigger/L1CaloTrigger/plugins/L1NNCaloTauEmulator.cc +++ b/L1Trigger/L1CaloTrigger/plugins/L1NNCaloTauEmulator.cc @@ -717,7 +717,6 @@ void L1NNCaloTauEmulator::produce(edm::Event& iEvent, const edm::EventSetup& eSe } // End while loop of barrel TowerClusters creation // Barrel TauMinator application - tensorflow::setLogging("2"); int batchSize_CB = (int)(Nclusters_CB); tensorflow::TensorShape imageShape_CB({batchSize_CB, IEta_dim, IPhi_dim, 2}); tensorflow::TensorShape positionShape_CB({batchSize_CB, 2}); diff --git a/L1Trigger/L1CaloTrigger/plugins/L1NNCaloTauProducer.cc b/L1Trigger/L1CaloTrigger/plugins/L1NNCaloTauProducer.cc index 23f3939ec6ca0..a9ba9f2996419 100644 --- a/L1Trigger/L1CaloTrigger/plugins/L1NNCaloTauProducer.cc +++ b/L1Trigger/L1CaloTrigger/plugins/L1NNCaloTauProducer.cc @@ -582,7 +582,6 @@ void L1NNCaloTauProducer::produce(edm::Event& iEvent, const edm::EventSetup& eSe } // End while loop of endcap TowerClusters creation // Barrel TauMinator application - tensorflow::setLogging("2"); int batchSize_CB = (int)(l1TowerClustersNxM_CB.size()); tensorflow::TensorShape imageShape_CB({batchSize_CB, IEta_dim, IPhi_dim, 2}); tensorflow::TensorShape positionShape_CB({batchSize_CB, 2}); diff --git a/L1Trigger/L1THGCal/src/concentrator/HGCalConcentratorAutoEncoderImpl.cc b/L1Trigger/L1THGCal/src/concentrator/HGCalConcentratorAutoEncoderImpl.cc index 80d87086311f4..654a5b696ee8e 100644 --- a/L1Trigger/L1THGCal/src/concentrator/HGCalConcentratorAutoEncoderImpl.cc +++ b/L1Trigger/L1THGCal/src/concentrator/HGCalConcentratorAutoEncoderImpl.cc @@ -61,8 +61,6 @@ HGCalConcentratorAutoEncoderImpl::HGCalConcentratorAutoEncoderImpl(const edm::Pa } } - tensorflow::setLogging("0"); - for (const auto& modelFilePset : modelFilePaths_) { std::string encoderPath = modelFilePset.getParameter("encoderModelFile").fullPath(); std::string decoderPath = modelFilePset.getParameter("decoderModelFile").fullPath(); diff --git a/L1Trigger/Phase2L1ParticleFlow/plugins/L1NNTauProducer.cc b/L1Trigger/Phase2L1ParticleFlow/plugins/L1NNTauProducer.cc index 0b0e8064f3cfb..0c4bd3d34eed0 100644 --- a/L1Trigger/Phase2L1ParticleFlow/plugins/L1NNTauProducer.cc +++ b/L1Trigger/Phase2L1ParticleFlow/plugins/L1NNTauProducer.cc @@ -81,7 +81,6 @@ L1NNTauProducer::L1NNTauProducer(const edm::ParameterSet& cfg, const tensorflow: } std::unique_ptr L1NNTauProducer::initializeGlobalCache(const edm::ParameterSet& cfg) { - tensorflow::setLogging("3"); std::string graphPath = edm::FileInPath(cfg.getParameter("NNFileName")).fullPath(); return std::make_unique(graphPath); } diff --git a/PhysicsTools/TensorFlow/interface/TensorFlow.h b/PhysicsTools/TensorFlow/interface/TensorFlow.h index 451b854ed2196..4f35a2c206143 100644 --- a/PhysicsTools/TensorFlow/interface/TensorFlow.h +++ b/PhysicsTools/TensorFlow/interface/TensorFlow.h @@ -57,9 +57,6 @@ namespace tensorflow { Backend getBackend() const { return _backend; }; }; - // set the tensorflow log level - void setLogging(const std::string& level = "3"); - // loads a meta graph definition saved at exportDir using the SavedModel interface for a tag and // predefined options // transfers ownership diff --git a/PhysicsTools/TensorFlow/src/TensorFlow.cc b/PhysicsTools/TensorFlow/src/TensorFlow.cc index 4ba5b80d823fd..6773c9f6177d2 100644 --- a/PhysicsTools/TensorFlow/src/TensorFlow.cc +++ b/PhysicsTools/TensorFlow/src/TensorFlow.cc @@ -87,16 +87,6 @@ namespace tensorflow { } } - void setLogging(const std::string& level) { - /* - * 0 = all messages are logged (default behavior) - * 1 = INFO messages are not printed - * 2 = INFO and WARNING messages are not printed - * 3 = INFO, WARNING, and ERROR messages are not printed - */ - setenv("TF_CPP_MIN_LOG_LEVEL", level.c_str(), 0); - } - MetaGraphDef* loadMetaGraphDef(const std::string& exportDir, const std::string& tag) { Options default_options{}; return loadMetaGraphDef(exportDir, tag, default_options); diff --git a/PhysicsTools/TensorFlow/test/testConstSessionCUDA.cc b/PhysicsTools/TensorFlow/test/testConstSessionCUDA.cc index aa34e457c0a50..e897b9d26efca 100644 --- a/PhysicsTools/TensorFlow/test/testConstSessionCUDA.cc +++ b/PhysicsTools/TensorFlow/test/testConstSessionCUDA.cc @@ -54,7 +54,6 @@ process.add_(cms.Service('CUDAService')) // load the graph std::string pbFile = dataPath_ + "/constantgraph.pb"; - tensorflow::setLogging(); tensorflow::Options options{backend}; tensorflow::GraphDef* graphDef = tensorflow::loadGraphDef(pbFile); diff --git a/PhysicsTools/TensorFlow/test/testGraphLoadingCUDA.cc b/PhysicsTools/TensorFlow/test/testGraphLoadingCUDA.cc index 8de6395343d91..84b41901a21ba 100644 --- a/PhysicsTools/TensorFlow/test/testGraphLoadingCUDA.cc +++ b/PhysicsTools/TensorFlow/test/testGraphLoadingCUDA.cc @@ -54,7 +54,6 @@ process.add_(cms.Service('CUDAService')) // load the graph std::string pbFile = dataPath_ + "/constantgraph.pb"; - tensorflow::setLogging(); tensorflow::Options options{backend}; tensorflow::GraphDef* graphDef = tensorflow::loadGraphDef(pbFile); CPPUNIT_ASSERT(graphDef != nullptr); diff --git a/PhysicsTools/TensorFlow/test/testHelloWorld.cc b/PhysicsTools/TensorFlow/test/testHelloWorld.cc index 8a0a16cb4afea..511c71c7b1abf 100644 --- a/PhysicsTools/TensorFlow/test/testHelloWorld.cc +++ b/PhysicsTools/TensorFlow/test/testHelloWorld.cc @@ -37,7 +37,6 @@ void testHelloWorld::test() { // object to load and run the graph / session tensorflow::Status status; tensorflow::Options options{backend}; - tensorflow::setLogging(); tensorflow::RunOptions runOptions; tensorflow::SavedModelBundle bundle; diff --git a/PhysicsTools/TensorFlow/test/testHelloWorldCUDA.cc b/PhysicsTools/TensorFlow/test/testHelloWorldCUDA.cc index 4824359a4f544..56c9c8c13ef54 100644 --- a/PhysicsTools/TensorFlow/test/testHelloWorldCUDA.cc +++ b/PhysicsTools/TensorFlow/test/testHelloWorldCUDA.cc @@ -57,7 +57,6 @@ process.add_(cms.Service('CUDAService')) // object to load and run the graph / session tensorflow::Status status; tensorflow::Options options{backend}; - tensorflow::setLogging("0"); tensorflow::RunOptions runOptions; tensorflow::SavedModelBundle bundle; diff --git a/PhysicsTools/TensorFlow/test/testMetaGraphLoadingCUDA.cc b/PhysicsTools/TensorFlow/test/testMetaGraphLoadingCUDA.cc index c550b55918f46..a9a7bf7e2b931 100644 --- a/PhysicsTools/TensorFlow/test/testMetaGraphLoadingCUDA.cc +++ b/PhysicsTools/TensorFlow/test/testMetaGraphLoadingCUDA.cc @@ -54,7 +54,6 @@ process.add_(cms.Service('CUDAService')) // load the graph std::string exportDir = dataPath_ + "/simplegraph"; - tensorflow::setLogging(); tensorflow::Options options{backend}; tensorflow::MetaGraphDef* metaGraphDef = tensorflow::loadMetaGraphDef(exportDir); CPPUNIT_ASSERT(metaGraphDef != nullptr); diff --git a/PhysicsTools/TensorFlow/test/testSessionCacheCUDA.cc b/PhysicsTools/TensorFlow/test/testSessionCacheCUDA.cc index 651eed4aadc19..d099e6a15877d 100644 --- a/PhysicsTools/TensorFlow/test/testSessionCacheCUDA.cc +++ b/PhysicsTools/TensorFlow/test/testSessionCacheCUDA.cc @@ -53,7 +53,6 @@ process.add_(cms.Service('CUDAService')) // load the graph and the session std::string pbFile = dataPath_ + "/constantgraph.pb"; - tensorflow::setLogging(); tensorflow::Options options{backend}; // load the graph and the session diff --git a/PhysicsTools/TensorFlow/test/testThreadPoolsCUDA.cc b/PhysicsTools/TensorFlow/test/testThreadPoolsCUDA.cc index 5c89aebfb407b..d8e8ae4ee88f3 100644 --- a/PhysicsTools/TensorFlow/test/testThreadPoolsCUDA.cc +++ b/PhysicsTools/TensorFlow/test/testThreadPoolsCUDA.cc @@ -60,7 +60,6 @@ process.add_(cms.Service('CUDAService')) // load the graph std::string pbFile = dataPath_ + "/constantgraph.pb"; - tensorflow::setLogging(); tensorflow::GraphDef* graphDef = tensorflow::loadGraphDef(pbFile); CPPUNIT_ASSERT(graphDef != nullptr); diff --git a/PhysicsTools/TensorFlow/test/testVisibleDevicesCUDA.cc b/PhysicsTools/TensorFlow/test/testVisibleDevicesCUDA.cc index 29f424f6cee0f..c44fea735bd77 100644 --- a/PhysicsTools/TensorFlow/test/testVisibleDevicesCUDA.cc +++ b/PhysicsTools/TensorFlow/test/testVisibleDevicesCUDA.cc @@ -55,11 +55,9 @@ process.add_(cms.Service('CUDAService')) std::cout << "Testing CUDA backend" << std::endl; tensorflow::Backend backend = tensorflow::Backend::cuda; tensorflow::Options options{backend}; - tensorflow::setLogging("0"); // load the graph std::string pbFile = dataPath_ + "/constantgraph.pb"; - tensorflow::setLogging(); tensorflow::GraphDef* graphDef = tensorflow::loadGraphDef(pbFile); CPPUNIT_ASSERT(graphDef != nullptr); diff --git a/RecoEcal/EgammaCoreTools/src/DeepSCGraphEvaluation.cc b/RecoEcal/EgammaCoreTools/src/DeepSCGraphEvaluation.cc index 9fae05b9b64d0..71737194a6c51 100644 --- a/RecoEcal/EgammaCoreTools/src/DeepSCGraphEvaluation.cc +++ b/RecoEcal/EgammaCoreTools/src/DeepSCGraphEvaluation.cc @@ -28,7 +28,6 @@ const std::vector DeepSCGraphEvaluation::availableWindowInputs = { const std::vector DeepSCGraphEvaluation::availableHitsInputs = {"ieta", "iphi", "iz", "en_withfrac"}; DeepSCGraphEvaluation::DeepSCGraphEvaluation(const DeepSCConfiguration& cfg) : cfg_(cfg) { - tensorflow::setLogging("0"); // Init TF graph and session objects initTensorFlowGraphAndSession(); // Init scaler configs diff --git a/RecoMuon/TrackerSeedGenerator/plugins/TSGForOIDNN.cc b/RecoMuon/TrackerSeedGenerator/plugins/TSGForOIDNN.cc index 02f10e21145ad..e771f7ba6a073 100644 --- a/RecoMuon/TrackerSeedGenerator/plugins/TSGForOIDNN.cc +++ b/RecoMuon/TrackerSeedGenerator/plugins/TSGForOIDNN.cc @@ -208,7 +208,6 @@ TSGForOIDNN::TSGForOIDNN(const edm::ParameterSet& iConfig) if (getStrategyFromDNN_) { edm::FileInPath dnnMetadataPath(dnnMetadataPath_); pt::read_json(dnnMetadataPath.fullPath(), metadata_); - tensorflow::setLogging("3"); if (useRegressor_) { // use regressor diff --git a/RecoTauTag/HLTProducers/src/L2TauTagNNProducer.cc b/RecoTauTag/HLTProducers/src/L2TauTagNNProducer.cc index 2fe15fd097279..7778fb7b9bd71 100644 --- a/RecoTauTag/HLTProducers/src/L2TauTagNNProducer.cc +++ b/RecoTauTag/HLTProducers/src/L2TauTagNNProducer.cc @@ -234,8 +234,6 @@ std::unique_ptr L2TauNNProducer::initializeGlobalCache cacheData->graphDef = tensorflow::loadGraphDef(graphPath); cacheData->session = tensorflow::createSession(cacheData->graphDef); - tensorflow::setLogging("2"); - boost::property_tree::ptree loadPtreeRoot; auto const normalizationDict = edm::FileInPath(cfg.getParameter("normalizationDict")).fullPath(); boost::property_tree::read_json(normalizationDict, loadPtreeRoot); diff --git a/RecoTauTag/HLTProducers/src/L2TauTagNNProducerAlpaka.cc b/RecoTauTag/HLTProducers/src/L2TauTagNNProducerAlpaka.cc index 9940650cfb7af..d5179879e387c 100644 --- a/RecoTauTag/HLTProducers/src/L2TauTagNNProducerAlpaka.cc +++ b/RecoTauTag/HLTProducers/src/L2TauTagNNProducerAlpaka.cc @@ -233,8 +233,6 @@ std::unique_ptr L2TauNNProducerAlpaka::initializ cacheData->graphDef = tensorflow::loadGraphDef(graphPath); cacheData->session = tensorflow::createSession(cacheData->graphDef); - tensorflow::setLogging("2"); - boost::property_tree::ptree loadPtreeRoot; auto const normalizationDict = edm::FileInPath(cfg.getParameter("normalizationDict")).fullPath(); boost::property_tree::read_json(normalizationDict, loadPtreeRoot);