2.4K Star 8.2K Fork 4.4K

GVPMindSpore / mindspore

 / 详情

[CI][MS][LITE][java]云测推理三合一版本,模型编译失败

DONE
Bug-Report
创建于  
2023-09-06 18:42
name about labels
Bug Report Use this template for reporting a bug kind/bug

Describe the current behavior / 问题描述 (Mandatory / 必填)

云测推理三合一版本,模型编译失败,涉及model接口和runner接口

Environment / 环境信息 (Mandatory / 必填)

  • Hardware Environment(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 / 请删除不涉及的模式:

Related testcase / 关联用例 (Mandatory / 必填)

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);
    }

Steps to reproduce the issue / 重现步骤 (Mandatory / 必填)

  1. 模型转化生成mindir模型
  2. 设置环境变量,链接mindspore-lite-java.jar
  3. 执行推理

Describe the expected behavior / 预期结果 (Mandatory / 必填)

模型编译成功

Related log / screenshot / 日志 / 截图 (Mandatory / 必填)

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

Special notes for this issue/备注 (Optional / 选填)

评论 (4)

fengyue25 创建了Bug-Report
fengyue25 添加了
 
kind/bug
标签
fengyue25 添加了
 
attr/function
标签
fengyue25 添加了
 
sig/mslite
标签
fengyue25 添加了
 
v2.2.0
标签
fengyue25 添加了
 
v2.3.0
标签
fengyue25 添加协作者chenjianping
fengyue25 添加协作者HidyLi
fengyue25 添加协作者邹丹音
fengyue25 添加协作者fengyue25
fengyue25 添加协作者chengfeng27
fengyue25 移除了
 
v2.3.0
标签
fengyue25 移除了
 
v2.3.0
标签
xiaoxiongzhu 负责人xiaoxiongzhu 修改为liyan2022
展开全部操作日志

经验证,是 !58401:修改文件权限/commits pr 修改并删除了文件路径导致 @liyan2022

liyan2022 任务状态TODO 修改为VALIDATION
liyan2022 添加协作者liyan2022
liyan2022 负责人liyan2022 修改为fengyue25
liyan2022 取消协作者fengyue25

问题定位: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

liyan2022 里程碑B-SIG-MSLite 修改为B-LiteTest
liyan2022 添加了
 
rca/others
标签
liyan2022 添加了
 
ctl/codereview
标签
liyan2022 添加了
 
rct/bugfix
标签

是否需要补充ST/UT:否
原因:java云侧版本已添加基本功能用例,这个模块功能单一,代码基本固定不会变,无需再添加用例。

fengyue25 任务状态VALIDATION 修改为DONE
fangwenyi 里程碑B-LiteTest 修改为B-ComponentTest

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(7)
6557666 hidyli 1648689999 6575282 jpc chenjianping 1584443114
Python
1
https://gitee.com/mindspore/mindspore.git
git@gitee.com:mindspore/mindspore.git
mindspore
mindspore
mindspore

搜索帮助