-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Onnx2NeoML executable #507
Conversation
Signed-off-by: Boris Zimka <boris.zimka@abbyy.com>
Signed-off-by: Boris Zimka <boris.zimka@abbyy.com>
Signed-off-by: Boris Zimka <boris.zimka@abbyy.com>
Signed-off-by: Boris Zimka <boris.zimka@abbyy.com>
Signed-off-by: Boris Zimka <boris.zimka@abbyy.com>
Signed-off-by: Boris Zimka <boris.zimka@abbyy.com>
NeoML/CMakeLists.txt
Outdated
@@ -82,7 +82,7 @@ endif() | |||
if(NeoML_INSTALL) | |||
set(INSTALLED_TARGETS NeoML NeoMathEngine) | |||
if(NeoOnnx_BUILD) | |||
list(APPEND INSTALLED_TARGETS NeoOnnx) | |||
list(APPEND INSTALLED_TARGETS NeoOnnx ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- (мелочь) надо убрать пробел
- (не мелочь) надо добавить эту утилиту в install. Как пример:
if(TARGET Onnx2NeoML)
list(APPEND INSTALLED_TARGETS Onnx2NeoML)
endif()
или NOT IOS NOT ANDROID
NeoOnnx/src/CMakeLists.txt
Outdated
@@ -88,6 +88,9 @@ target_sources( ${PROJECT_NAME} PRIVATE | |||
TensorLayout.h | |||
TensorUtils.h | |||
) | |||
if(NOT ANDROID AND NOT IOS) | |||
add_subdirectory(Onnx2NeoML) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(мелочь) Я бы перенес либо в выше (где-нибудь сразу после add_library
) либо в самый низ. Иначе как-то неочевидно, что посередине CMake который описывает сборку NeoOnnx внезапно затесалась доп. утилита.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ой, вообще лучше всю утилиту вынести в отдельную поддиректорию на уровень выше! А этот if перенести NeoML/NeoOnnx/CMakeLists.txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Надо добавить утилиту в install.
Надо её расположить не внутри src
а сбоку от src
директории, на уровень выше.
Signed-off-by: Boris Zimka <boris.zimka@abbyy.com>
Перенес утилиту на уровень выше (в NeoOnnx из NeoOnnx/src), добавил в install кроме мобилок |
В PR добавляется простейшая исполняемая обертка вокруг NeoOnnx::LoadFromOnnx.
Сейчас NeoOnnx предоставляет программное api для конвертации Onnx в CDnn (NeoOnnx::LoadFromOnnx).
Т.к. NeoOnnx нельзя собрать вместе с FineObjects, использовать это api в проектах на основе FineObj сложно. Для конвертации onnx-сети приходится создавать новое временное приложение, что не очень удобно.
С другой стороны, в процессе конвертации нет никаких параметров/флагов/настроек, и, например, в tf2onnx можно конвертировать и через cli, и через программный api.
Здесь по аналогии добавлен executable, который выполняет конвертацию.
Протестировано на нейронке с одним Dense слоем.