Skip to content
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

OSError: [WinError 87] 参数错误。(SUOD) #437

Open
campbell0112 opened this issue Sep 9, 2022 · 1 comment
Open

OSError: [WinError 87] 参数错误。(SUOD) #437

campbell0112 opened this issue Sep 9, 2022 · 1 comment

Comments

@campbell0112
Copy link

[Parallel(n_jobs=7)]: Using backend LokyBackend with 7 concurrent workers.
[Parallel(n_jobs=7)]: Done 2 out of 7 | elapsed: 4.1min remaining: 10.3min

_RemoteTraceback Traceback (most recent call last)
_RemoteTraceback:
"""
Traceback (most recent call last):
File "C:\ProgramData\Miniconda3\lib\site-packages\joblib\externals\loky\process_executor.py", line 359, in _sendback_result
result_queue.put(_ResultItem(work_id, result=result,
File "C:\ProgramData\Miniconda3\lib\site-packages\joblib\externals\loky\backend\queues.py", line 244, in put
self._writer.send_bytes(obj)
File "C:\ProgramData\Miniconda3\lib\multiprocessing\connection.py", line 205, in send_bytes
self._send_bytes(m[offset:offset + size])
File "C:\ProgramData\Miniconda3\lib\multiprocessing\connection.py", line 285, in _send_bytes
ov, err = _winapi.WriteFile(self._handle, buf, overlapped=True)
OSError: [WinError 87] 参数错误。
"""

The above exception was the direct cause of the following exception:

OSError Traceback (most recent call last)
Input In [12], in <cell line: 1>()
----> 1 clf.fit(data)

File C:\ProgramData\Miniconda3\lib\site-packages\pyod\models\suod.py:210, in SUOD.fit(self, X, y)
207 self.set_n_classes(y)
209 # fit the model and then approximate it
--> 210 self.model
.fit(X)
211 self.model_.approximate(X)
213 # get the decision scores from each base estimators

File C:\ProgramData\Miniconda3\lib\site-packages\suod\models\base.py:286, in SUOD.fit(self, X)
280 start = time.time()
282 # TODO: code cleanup. There is an existing bug for joblib on Windows:
283 # joblib/joblib#806
284 # a fix is on the way: joblib/joblib#966
285 # max_nbytes can be dropped on other OS
--> 286 all_results = Parallel(n_jobs=n_jobs, max_nbytes=None, verbose=True)(
287 delayed(parallel_fit)(
288 n_estimators_list[i],
289 self.base_estimators[starts[i]:starts[i + 1]],
290 X,
291 self.n_estimators,
292 self.rp_flags[starts[i]:starts[i + 1]],
293 self.target_dim_frac
,
294 self.jl_method,
295 verbose=self.verbose)
296 for i in range(n_jobs))
298 if self.verbose:
299 print('Balanced Scheduling Total Train Time:', time.time() - start)

File C:\ProgramData\Miniconda3\lib\site-packages\joblib\parallel.py:1056, in Parallel.call(self, iterable)
1053 self._iterating = False
1055 with self._backend.retrieval_context():
-> 1056 self.retrieve()
1057 # Make sure that we get a last message telling us we are done
1058 elapsed_time = time.time() - self._start_time

File C:\ProgramData\Miniconda3\lib\site-packages\joblib\parallel.py:935, in Parallel.retrieve(self)
933 try:
934 if getattr(self._backend, 'supports_timeout', False):
--> 935 self._output.extend(job.get(timeout=self.timeout))
936 else:
937 self._output.extend(job.get())

File C:\ProgramData\Miniconda3\lib\site-packages\joblib_parallel_backends.py:542, in LokyBackend.wrap_future_result(future, timeout)
539 """Wrapper for Future.result to implement the same behaviour as
540 AsyncResults.get from multiprocessing."""
541 try:
--> 542 return future.result(timeout=timeout)
543 except CfTimeoutError as e:
544 raise TimeoutError from e

File C:\ProgramData\Miniconda3\lib\concurrent\futures_base.py:446, in Future.result(self, timeout)
444 raise CancelledError()
445 elif self._state == FINISHED:
--> 446 return self.__get_result()
447 else:
448 raise TimeoutError()

File C:\ProgramData\Miniconda3\lib\concurrent\futures_base.py:391, in Future.__get_result(self)
389 if self._exception:
390 try:
--> 391 raise self._exception
392 finally:
393 # Break a reference cycle with the exception in self._exception
394 self = None

OSError: [WinError 87] 参数错误。

@yzhao062
Copy link
Owner

yzhao062 commented Sep 9, 2022

I think that is the issue of joblib on Windows (joblib/joblib#1002) using the LokyBackend.

In that sense, we need to update suod library to using threading backend for windows...there is no easy workaround I guess but a bug fix is needed...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants