nncf
nncf copied to clipboard
Enable to load models with low opset version
Changes
- Enable to load models with low opset version
- Add to change tensor shape in Accuracy
Reason for changes
-
The models with opset==7, 8, 9 have not only input tensor, but also every weight and bias in original_model.graph.input. But the model with opset==12, which have only input tensor in original_model.graph.input, can be only loaded. <opset==7, 8, 9>
<opset==12>
-
densenets output a 4d tensor , but Accuracy metric cannot use it because it can only handle a 2d tensor.
Related tickets
88636
Tests
@sungchul2 thanks! Could you also add a test that will failed without your fix and pass with it?
@sungchul2 Please rebase this PR on the latest develop branch and push again. This is because of https://github.com/openvinotoolkit/nncf/pull/1248.
run tensorflow pre-commit tests
run pytorch pre-commit tests
@sungchul2 , do you plan to finalize this PR?
run pytorch pre-commit tests
@kshpv I saw models from torchvision just have single input, not multiple inputs, and it is not the purpose of this ticket. So, I changed them to models from onnx model zoo, which directly have had this issue, such as densenet.
And I added Mask R-CNN and yolov3 for test as you requested. These models have dynamic input_shape and have been converted with high opset version (10, 12). So, I separately added a test for them and renamed the test file.
@sungchul2 thank you for the PR. It looks very good!
retest this please