autokeras: Got 'NotImplementedError' on macOS
Bug Description
Traceback (most recent call last): File "test.py", line 29, in <module> clf.fit(x_train, y_train, time_limit=60 * 60) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/autokeras/image/image_supervised.py", line 114, in fit super().fit(x, y, time_limit) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/autokeras/supervised.py", line 129, in fit self.cnn.fit(self.get_n_output_node(), x_train.shape, train_data, test_data, time_limit) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/autokeras/net_module.py", line 65, in fit self.searcher.search(train_data, test_data, int(time_remain)) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/autokeras/search.py", line 200, in search generated_other_info, generated_graph = self.generate(remaining_time, q) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/autokeras/search.py", line 251, in generate remaining_time, multiprocessing_queue) File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/autokeras/bayesian.py", line 350, in generate if multiprocessing_queue.qsize() != 0: File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/queues.py", line 117, in qsize return self._maxsize - self._sem._semlock._get_value() NotImplementedError
Reproducing Steps
Just run ‘Data with numpy array (.npy) format.’ example
Setup Details
Include the details about the versions of:
- OS type and version: macOS 10.14.2
- Python: 3.6
Additional context
seems this is causing the issue: https://docs.python.org/3/library/multiprocessing.html#multiprocessing.Queue.qsize
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 22 (7 by maintainers)
I’m getting this error on Big Sur, python3.8 when calling
multiprocessing.queues.Queue.qsize(), why is the issue closed? Something feels weird about this issue that no one tried to fix. Even in thequeues.pymodule, there’s a comment marking the line as problematic and yet nothing seems to change over time.Since this is an old problem, I’ve found a posible solution that other project (lemon) has taken: to subclass the Queue class in order to make it portable. This is the code (comes from https://github.com/vterron/lemon/commit/9ca6b4b1212228dbd4f69b88aaf88b12952d7d6f):
@nanshihui It is
multiprocessing.queues, notmultiprocessing.Queues. Just tried on Python3.7 and Python2.7.EDIT: snap NO!!! It works if you try to import it in the Python shell, but referencing it directly like the code given doesn’t work.
EDIT: do this (Python2)
EDIT: in Python3, this code has a problem:
Solution: https://stackoverflow.com/questions/24941359/ctx-parameter-in-multiprocessing-queue