autodeployai / pypmml

Python PMML scoring library
Apache License 2.0
75 stars 22 forks source link

File doesn't load #39

Closed Selphie14100 closed 2 years ago

Selphie14100 commented 2 years ago

When I try to do Model.load I get a file not found error . Not sure why as I can open the file. Any ideas? I enclose the file .


FileNotFoundError Traceback (most recent call last) ~\AppData\Local\Temp/ipykernel_11020/3468497621.py in ----> 1 model=Model.load("GBAW12ml-1.xml")

~\anaconda3\lib\site-packages\pypmml\model.py in load(cls, f) 232 # Check if a file path 233 if os.path.exists(model_content): --> 234 model = cls.fromFile(model_content) 235 else: 236 model = cls.fromString(model_content)

~\anaconda3\lib\site-packages\pypmml\model.py in fromFile(cls, name) 188 def fromFile(cls, name): 189 """Load a model from PMML file with given pathname""" --> 190 pc = PMMLContext.getOrCreate() 191 try: 192 java_model = pc._jvm.org.pmml4s.model.Model.fromFile(name)

~\anaconda3\lib\site-packages\pypmml\base.py in getOrCreate(cls) 75 with PMMLContext._lock: 76 if PMMLContext._active_pmml_context is None: ---> 77 PMMLContext() 78 return PMMLContext._active_pmml_context 79

~\anaconda3\lib\site-packages\pypmml\base.py in init(self, gateway) 49 50 def init(self, gateway=None): ---> 51 PMMLContext._ensure_initialized(self, gateway=gateway) 52 53 @classmethod

~\anaconda3\lib\site-packages\pypmml\base.py in _ensure_initialized(cls, instance, gateway) 58 with PMMLContext._lock: 59 if not PMMLContext._gateway: ---> 60 PMMLContext._gateway = gateway or cls.launch_gateway() 61 PMMLContext._jvm = PMMLContext._gateway.jvm 62

~\anaconda3\lib\site-packages\pypmml\base.py in launch_gateway(cls, javaopts, java_path) 96 javaopts = java_opts.split() 97 ---> 98 _port = launch_gateway(classpath=launch_classpath, javaopts=javaopts, java_path=java_path, die_on_exit=True) 99 gateway = JavaGateway( 100 gateway_parameters=GatewayParameters(port=_port,

~\anaconda3\lib\site-packages\py4j\java_gateway.py in launch_gateway(port, jarpath, classpath, javaopts, die_on_exit, redirect_stdout, redirect_stderr, daemonize_redirect, java_path, create_new_process_group, enable_auth, cwd, return_proc, use_shell) 329 330 popen_kwargs["shell"] = use_shell --> 331 proc = Popen( 332 command, stdout=PIPE, stdin=PIPE, stderr=stderr, cwd=cwd, 333 **popen_kwargs)

~\anaconda3\lib\subprocess.py in init(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask) 949 encoding=encoding, errors=errors) 950 --> 951 self._execute_child(args, executable, preexec_fn, close_fds, 952 pass_fds, cwd, env, 953 startupinfo, creationflags, shell,

~\anaconda3\lib\subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_gid, unused_gids, unused_uid, unused_umask, unused_start_new_session) 1418 # Start the process 1419 try: -> 1420 hp, ht, pid, tid = _winapi.CreateProcess(executable, args, 1421 # no special security 1422 None, None,

FileNotFoundError: [WinError 2] The system cannot find the file specified

This is the file GBAW12ml-1.zip

Selphie14100 commented 2 years ago

Good news. Tracked it to an issue with Java reinstalled java all good.