@@ -735,20 +735,9 @@ struct DataLayer : public Layer
735
735
}
736
736
biases->set (biasesVec);
737
737
738
- #if INF_ENGINE_VER_MAJOR_GE(INF_ENGINE_RELEASE_2018R5)
739
738
InferenceEngine::Builder::Layer ieLayer = InferenceEngine::Builder::ScaleShiftLayer (name);
740
739
addConstantData (" weights" , weights, ieLayer);
741
740
addConstantData (" biases" , biases, ieLayer);
742
- #else
743
- InferenceEngine::LayerParams lp;
744
- lp.name = name;
745
- lp.type = " ScaleShift" ;
746
- lp.precision = InferenceEngine::Precision::FP32;
747
- std::shared_ptr<InferenceEngine::ScaleShiftLayer> ieLayer (new InferenceEngine::ScaleShiftLayer (lp));
748
-
749
- ieLayer->_weights = weights;
750
- ieLayer->_biases = biases;
751
- #endif
752
741
return Ptr <BackendNode>(new InfEngineBackendNode (ieLayer));
753
742
#endif // HAVE_INF_ENGINE
754
743
return Ptr <BackendNode>();
@@ -1488,11 +1477,7 @@ struct Net::Impl
1488
1477
if (layerNet != ieInpNode->net )
1489
1478
{
1490
1479
// layerNet is empty or nodes are from different graphs.
1491
- #if INF_ENGINE_VER_MAJOR_GE(INF_ENGINE_RELEASE_2018R5)
1492
1480
ieInpNode->net ->addOutput (ieInpNode->layer .getName ());
1493
- #else
1494
- ieInpNode->net ->addOutput (ieInpNode->layer ->name );
1495
- #endif
1496
1481
}
1497
1482
}
1498
1483
}
@@ -1642,25 +1627,6 @@ struct Net::Impl
1642
1627
}
1643
1628
}
1644
1629
1645
- #if INF_ENGINE_VER_MAJOR_LT(INF_ENGINE_RELEASE_2018R5)
1646
- // The same blobs wrappers cannot be shared between two Inference Engine
1647
- // networks because of explicit references between layers and blobs.
1648
- // So we need to rewrap all the external blobs.
1649
- for (int i = 0 ; i < ld.inputBlobsId .size (); ++i)
1650
- {
1651
- LayerPin inPin = ld.inputBlobsId [i];
1652
- auto it = netBlobsWrappers.find (inPin);
1653
- if (it == netBlobsWrappers.end ())
1654
- {
1655
- ld.inputBlobsWrappers [i] = InfEngineBackendWrapper::create (ld.inputBlobsWrappers [i]);
1656
- netBlobsWrappers[inPin] = ld.inputBlobsWrappers [i];
1657
- }
1658
- else
1659
- ld.inputBlobsWrappers [i] = it->second ;
1660
- }
1661
- netBlobsWrappers[LayerPin (ld.id , 0 )] = ld.outputBlobsWrappers [0 ];
1662
- #endif // IE < R5
1663
-
1664
1630
Ptr <BackendNode> node;
1665
1631
if (!net.empty ())
1666
1632
{
@@ -1691,7 +1657,6 @@ struct Net::Impl
1691
1657
ieNode->net = net;
1692
1658
1693
1659
// Convert weights in FP16 for specific targets.
1694
- #if INF_ENGINE_VER_MAJOR_GE(INF_ENGINE_RELEASE_2018R5)
1695
1660
if ((preferableTarget == DNN_TARGET_OPENCL_FP16 ||
1696
1661
preferableTarget == DNN_TARGET_MYRIAD ||
1697
1662
preferableTarget == DNN_TARGET_FPGA) && !fused)
@@ -1733,47 +1698,6 @@ struct Net::Impl
1733
1698
net->addBlobs (ld.inputBlobsWrappers );
1734
1699
net->addBlobs (ld.outputBlobsWrappers );
1735
1700
addInfEngineNetOutputs (ld);
1736
-
1737
- #else // IE >= R5
1738
-
1739
- auto weightableLayer = std::dynamic_pointer_cast<InferenceEngine::WeightableLayer>(ieNode->layer );
1740
- if ((preferableTarget == DNN_TARGET_OPENCL_FP16 ||
1741
- preferableTarget == DNN_TARGET_MYRIAD ||
1742
- preferableTarget == DNN_TARGET_FPGA) && !fused)
1743
- {
1744
- ieNode->layer ->precision = InferenceEngine::Precision::FP16;
1745
- if (weightableLayer)
1746
- {
1747
- if (weightableLayer->_weights )
1748
- weightableLayer->_weights = convertFp16 (weightableLayer->_weights );
1749
- if (weightableLayer->_biases )
1750
- weightableLayer->_biases = convertFp16 (weightableLayer->_biases );
1751
- }
1752
- else
1753
- {
1754
- for (const auto & weights : {" weights" , " biases" })
1755
- {
1756
- auto it = ieNode->layer ->blobs .find (weights);
1757
- if (it != ieNode->layer ->blobs .end ())
1758
- it->second = convertFp16 (it->second );
1759
- }
1760
- }
1761
- }
1762
- if (weightableLayer)
1763
- {
1764
- if (weightableLayer->_weights )
1765
- weightableLayer->blobs [" weights" ] = weightableLayer->_weights ;
1766
- if (weightableLayer->_biases )
1767
- weightableLayer->blobs [" biases" ] = weightableLayer->_biases ;
1768
- }
1769
- ieNode->connect (ld.inputBlobsWrappers , ld.outputBlobsWrappers );
1770
- net->addBlobs (ld.inputBlobsWrappers );
1771
- net->addBlobs (ld.outputBlobsWrappers );
1772
-
1773
- if (!fused)
1774
- net->addLayer (ieNode->layer );
1775
- addInfEngineNetOutputs (ld);
1776
- #endif // IE >= R5
1777
1701
}
1778
1702
1779
1703
// Initialize all networks.
@@ -1795,23 +1719,6 @@ struct Net::Impl
1795
1719
1796
1720
if (!ieNode->net ->isInitialized ())
1797
1721
{
1798
- #if INF_ENGINE_VER_MAJOR_EQ(INF_ENGINE_RELEASE_2018R4)
1799
- // For networks which is built in runtime we need to specify a
1800
- // version of it's hyperparameters.
1801
- std::string versionTrigger = " <net name=\" TestInput\" version=\" 3\" batch=\" 1\" >"
1802
- " <layers>"
1803
- " <layer name=\" data\" type=\" Input\" precision=\" FP32\" id=\" 0\" >"
1804
- " <output>"
1805
- " <port id=\" 0\" >"
1806
- " <dim>1</dim>"
1807
- " </port>"
1808
- " </output>"
1809
- " </layer>"
1810
- " </layers>"
1811
- " </net>" ;
1812
- InferenceEngine::CNNNetReader reader;
1813
- reader.ReadNetwork (versionTrigger.data (), versionTrigger.size ());
1814
- #endif
1815
1722
ieNode->net ->init (preferableTarget);
1816
1723
ld.skip = false ;
1817
1724
}
@@ -2693,11 +2600,7 @@ Net Net::readFromModelOptimizer(const String& xml, const String& bin)
2693
2600
Net cvNet;
2694
2601
cvNet.setInputsNames (inputsNames);
2695
2602
2696
- #if INF_ENGINE_VER_MAJOR_GE(INF_ENGINE_RELEASE_2018R5)
2697
2603
Ptr <InfEngineBackendNode> backendNode (new InfEngineBackendNode (InferenceEngine::Builder::Layer (" " )));
2698
- #else
2699
- Ptr <InfEngineBackendNode> backendNode (new InfEngineBackendNode (0 ));
2700
- #endif
2701
2604
backendNode->net = Ptr <InfEngineBackendNet>(new InfEngineBackendNet (ieNet));
2702
2605
for (auto & it : ieNet.getOutputsInfo ())
2703
2606
{
0 commit comments