pypmml icon indicating copy to clipboard operation
pypmml copied to clipboard

pypmml.base.PmmlError: ('FileNotFoundException',

Open faker-bert opened this issue 2 years ago • 1 comments

When I call the pmml file with pypmml across folders, this error always occurs when loading the model (the error is as follows), I try to modify the java version (the original is 1.7, modified to 1.8), the same situation still occurs

The path passed must be correct

Hope that fixes this

Traceback (most recent call last): File "E:\python_virtual_env\com_work\lib\site-packages\pypmml\model.py", line 192, in fromFile java_model = pc._jvm.org.pmml4s.model.Model.fromFile(name) File "E:\python_virtual_env\com_work\lib\site-packages\py4j\java_gateway.py", line 1322, in call return_value = get_return_value( File "E:\python_virtual_env\com_work\lib\site-packages\py4j\protocol.py", line 326, in get_return_value raise Py4JJavaError( py4j.protocol.Py4JJavaError: An error occurred while calling z:org.pmml4s.model.Model.fromFile. : java.io.FileNotFoundException: E:\python_virtual_env\com_work\SchedulerSystem\algorithmZoo\pmml_file\DecisionTreeIris.pmml (系统找不到指定的路径。) at java.base/java.io.FileInputStream.open0(Native Method) at java.base/java.io.FileInputStream.open(FileInputStream.java:216) at java.base/java.io.FileInputStream.(FileInputStream.java:157) at scala.io.Source$.fromFile(Source.scala:91) at scala.io.Source$.fromFile(Source.scala:76) at scala.io.Source$.fromFile(Source.scala:54) at org.pmml4s.model.Model$.fromFile(Model.scala:701) at org.pmml4s.model.Model.fromFile(Model.scala) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) at java.base/java.lang.reflect.Method.invoke(Method.java:577) at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244) at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:374) at py4j.Gateway.invoke(Gateway.java:282) at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132) at py4j.commands.CallCommand.execute(CallCommand.java:79) at py4j.GatewayConnection.run(GatewayConnection.java:238) at java.base/java.lang.Thread.run(Thread.java:833)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "E:/python_virtual_env/com_work/SchedulerSystem/algorithmZoo/iris_desicion_tree.py", line 7, in model = Model.fromFile(os.path.join(os.getcwd(), 'pmml_file/DecisionTreeIris.pmml')) File "E:\python_virtual_env\com_work\lib\site-packages\pypmml\model.py", line 196, in fromFile raise PmmlError(je.getClass().getSimpleName(), je.getMessage()) pypmml.base.PmmlError: ('FileNotFoundException', 'E:\python_virtual_env\com_work\SchedulerSystem\algorithmZoo\pmml_file\DecisionTreeIris.pmml (系统找不到指定的路径。)')

faker-bert avatar Aug 19 '22 02:08 faker-bert

@oslijw Could you make sure the following file exists?

E:\python_virtual_env\com_work\SchedulerSystem\algorithmZoo\pmml_file\DecisionTreeIris.pmml

You can use the Java code to verify, for example:

FileInputStream fis = new FileInputStream(new File(fileName));

scorebot avatar Aug 20 '22 04:08 scorebot

@oslijw Can we close the issue? Please let me know if you have any issues.

scorebot avatar Sep 19 '22 00:09 scorebot

@scorebot i have the file in local file system, but it still no work

faker-bert avatar Sep 20 '22 02:09 faker-bert

@oslijw Can the file pathname be opened by the code FileInputStream fis = new FileInputStream(new File(fileName));?

scorebot avatar Sep 22 '22 07:09 scorebot

actually i code by python I will try java for your advice

faker-bert avatar Sep 23 '22 12:09 faker-bert

i unuse pmml now,maybe i will use late

faker-bert avatar Sep 26 '22 01:09 faker-bert