name | about | labels |
---|---|---|
Bug Report | Use this template for reporting a bug | kind/bug |
云测推理三合一版本,模型编译失败,涉及model接口和runner接口
Ascend
/GPU
/CPU
) / 硬件环境:Please delete the backend not involved / 请删除不涉及的后端:
/device ascend/GPU/CPU
Software Environment / 软件环境 (Mandatory / 必填):
-- MindSpore version (e.g., 1.7.0.Bxxx) :
-- Python version (e.g., Python 3.7.5) :
-- OS platform and distribution (e.g., Linux Ubuntu 16.04):
-- GCC/Compiler version (if compiled from source):
Excute Mode / 执行模式 (Mandatory / 必填)(PyNative
/Graph
):
Please delete the mode not involved / 请删除不涉及的模式:
public void testBasicModelPredictTest() {
System.out.println(Version.version());
System.out.println("---start run JavaApiModelPredictTensor#testBasicModelPredictCreateTensor004----");
System.out.println("===================setcontext===================");
MSContext context = new MSContext();
context.init();
boolean ret1 = context.addDeviceInfo(DeviceType.DT_CPU, false);
Assert.assertTrue("init CPU context failed", ret1);
String modelPath = "./data/ml_video_edit_reid.mindir";
System.out.println("modelPath" + modelPath);
// Create the MindSpore lite session.
Model model = new Model();
// Compile graph.
System.out.println("==========model build by byteBuffer==========");
boolean build_ret = model.build(modelPath, ModelType.MT_MINDIR, context);
Assert.assertTrue("model build failed", build_ret);
}
模型编译成功
MindSpore Lite 2.2.0.20230905
---start run JavaApiModelPredictTensor#testBasicModelPredictCreateTensor004----
===================setcontext===================
Sep 06, 2023 3:28:01 PM com.mindspore.config.MindsporeLite <clinit>
INFO: MindsporeLite init ...
Sep 06, 2023 3:28:01 PM com.mindspore.config.MindsporeLite init
INFO: MindsporeLite init load ...
Sep 06, 2023 3:28:01 PM com.mindspore.config.NativeLibrary load
INFO: Native lib has been loaded.
Sep 06, 2023 3:28:01 PM com.mindspore.config.MindsporeLite init
INFO: MindsporeLite init load ...
Sep 06, 2023 3:28:01 PM com.mindspore.config.NativeLibrary load
INFO: Native lib has been loaded.
modelPath./data/ml_video_edit_reid.mindir
Sep 06, 2023 3:28:01 PM com.mindspore.config.MindsporeLite init
INFO: MindsporeLite init load ...
Sep 06, 2023 3:28:01 PM com.mindspore.config.NativeLibrary load
INFO: Native lib has been loaded.
==========model build by byteBuffer==========
[ERROR] ME(14522,7fb8a83a7700,java):2023-09-06-15:28:01.160.401 [mindspore/lite/src/extendrt/cxx_api/dlutils.h:38] FindFileWithRecursion] Can't open dir /tmp/mindspore_lite_libs-1693985279861-0/
[ERROR] ME(14522,7fb8a83a7700,java):2023-09-06-15:28:01.160.456 [mindspore/lite/src/extendrt/delegate/plugin/litert_executor_plugin.cc:52] Register] Get real path of libmsplugin-ge-litert.so failed.
[WARNING] ME(14522,7fb8a83a7700,java):2023-09-06-15:28:01.160.463 [mindspore/lite/src/extendrt/infer_session.cc:98] HandleContext] Failed to register LiteRT plugin
[ERROR] ME(14522,7fb8a83a7700,java):2023-09-06-15:28:01.160.475 [mindspore/lite/src/extendrt/cxx_api/model/model_impl.cc:361] BuildByBufferImpl] Create session failed.
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 2.338 sec <<< FAILURE!
testBasicModelPredictTest(predict.JavaApiModelPredictModel) Time elapsed: 2.301 sec <<< FAILURE!
junit.framework.AssertionFailedError: model build failed
at junit.framework.Assert.fail(Assert.java:50)
at junit.framework.Assert.assertTrue(Assert.java:20)
at predict.JavaApiModelPredictModel.testBasicModelPredictTest(JavaApiModelPredictModel.java:2055)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:242)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:137)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
ERROR [rc/main/native/model.cpp:207] Java_com_mindspore_Model_buildByPath] Error status -1 during build of model
Results :
Failed tests: testBasicModelPredictTest(predict.JavaApiModelPredictModel): model build failed
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
经验证,是 !58401:修改文件权限/commits pr 修改并删除了文件路径导致 @liyan2022
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
问题定位:java安全加固引入bug
解决方案:回退NativeLibrary修改
自验证: 执行quick_start demo,java -classpath .:./quick_start_java.jar:../lib/runtime/lib/mindspore-lite-java.jar com.mindspore.lite.demo.Main ../model/mobilenetv2.mindir
INFO: MindsporeLite init load ...
Sep 08, 2023 6:15:22 PM com.mindspore.config.NativeLibrary load
INFO: Native lib has been loaded.
out tensor shape: [1,1000,] and out data: 5.745378E-5 4.348891E-4 2.7509136E-4 3.3520907E-4 2.0523855E-4 8.615933E-5 2.850987E-4 3.4422355E-4 2.6371836E-4 1.8769536E-4 0.001186035 0.0044549885 0.002421445 0.0014953972 0.0031599305 0.0014962341 9.349183E-4 7.650274E-4 7.184983E-4 0.0016344071 5.56566E-4 0.0014625326 9.538155E-4 0.0014910052 3.628842E-4 1.3411745E-4 2.6625494E-4 4.1056113E-4 1.718681E-4 5.3932855E-4 2.1607644E-4 0.0011068425 1.10420835E-4 5.695535E-4 7.9346943E-4 3.3240754E-4 2.9004124E-4 3.392395E-4 0.002336384 5.050907E-4 0.001235955 6.7540864E-4 6.101409E-4 6.4389367E-4 6.0547673E-4 3.651128E-4 0.0015801868 2.0811782E-4 7.7402365E-5 8.9966205E-5
是否需要补充ST/UT:否
原因:java云侧版本已添加基本功能用例,这个模块功能单一,代码基本固定不会变,无需再添加用例。
回归通过
登录 后才可以发表评论