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
an AttributeError raised in mnist example 'NoneType' object has no attribute 'terminate' #311
Comments
Hi @cutechestnut. Thank you for the bug report, I'll be looking into this issue. |
i got this problem too,here is my error information.(autokeras0.3.1 windows10 py36) File "", line 1, in File "E:\anaconda\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile File "E:\anaconda\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile File "F:/Ranly_Obj/AdcancedTech/auto_example.py", line 27, in File "C:\Users\lenovo\AppData\Roaming\Python\Python36\site-packages\autokeras\image\image_supervised.py", line 123, in fit File "C:\Users\lenovo\AppData\Roaming\Python\Python36\site-packages\autokeras\supervised.py", line 140, in fit File "C:\Users\lenovo\AppData\Roaming\Python\Python36\site-packages\autokeras\net_module.py", line 60, in fit File "C:\Users\lenovo\AppData\Roaming\Python\Python36\site-packages\autokeras\search.py", line 238, in search File "E:\anaconda\lib\multiprocessing\process.py", line 116, in terminate AttributeError: 'NoneType' object has no attribute 'terminate' |
Hi, i got the same issue 5 minutes ago. May @tl-yang you have an solution ? |
@Timmmeyyy @EverKnows @cutechestnut I'm having a hard time reproducing the bug. Can you provide me with some more detail? Like how long do you run the mnist example until the error occurred? what is the console ouput(before the error) I think it might be a race condition. But I can't tell under what circumstances the error will occur. |
Hi, It also happens to me (Ubuntu 16.04.5 LTS), I am using a random generated dataset (np.random.rand), this is the code: # train.py file, run with "python3.6 train.py"
import numpy as np
import autokeras as ak
from tensorflow import set_random_seed
seed = 0
np.random.seed(seed)
set_random_seed(0)
x_train = np.random.rand(100, 30, 30, 1)
x_val = np.random.rand(70, 30, 30, 1)
y_train = np.random.rand(100)
y_val = np.random.rand(70)
clf = ak.ImageClassifier(verbose=True)
clf.fit(x_train, y_train, x_test=x_val, y_test=y_val) This is the error:
Then, I have to Ctrl-C for stopping the execution, which outputs:
Hope it helps! |
hi @Ivorra . I think you need to wrap your code in a |
@tl-yang Could you clarify how to do the wrapping? I am doing the following, but it just gives another error: import numpy as np
import autokeras as ak
from tensorflow import set_random_seed
def f():
seed = 0
np.random.seed(seed)
set_random_seed(seed)
x_train = np.random.rand(100, 30, 30, 1)
x_val = np.random.rand(70, 30, 30, 1)
y_train = np.random.rand(100)
y_val = np.random.rand(70)
clf = ak.ImageClassifier(verbose=True)
clf.fit(x_train, y_train, x_test=x_val, y_test=y_val)
if __name__ == '__main__':
f() And the error:
After Ctrl-C:
|
@Ivorra I think you just found another issue. Try to remove the x_test y_test parameter in the .fit function. It should work. |
@tl-yang It seems to give the same error, I just set the line to "clf.fit(x_train, y_train, x_val, y_val)". Is that what I should change? |
@Ivorra I mean remove the last two parameters: |
@tl-yang It seems that it gives the same error as before. Code: import numpy as np
import autokeras as ak
from tensorflow import set_random_seed
seed = 0
np.random.seed(seed)
set_random_seed(0)
x_train = np.random.rand(100, 30, 30, 1)
x_val = np.random.rand(70, 30, 30, 1)
y_train = np.ceil(np.random.rand(100))
y_val = np.ceil(np.random.rand(70))
clf = ak.ImageClassifier(verbose=True)
clf.fit(x_train, y_train) #, x_val, y_val)
Ctrl-C,
|
OK, think it works now: import numpy as np
import autokeras as ak
def f():
x_train = np.random.rand(100, 30, 30, 1)
x_val = np.random.rand(70, 30, 30, 1)
y_train = np.ceil(np.random.rand(100))
y_val = np.ceil(np.random.rand(70))
clf = ak.ImageClassifier(verbose=True)
clf.fit(x_train, y_train)
if __name__ == '__main__':
f() |
My question is, does then autokeras use the training accuracy as the main metric, instead of the validation one? |
@tl-yang def f():
if name=='main': and here is my error info Initializing search. +----------------------------------------------+ File "", line 1, in File "E:\anaconda\lib\site-packages\spyder\utils\site\sitecustomize.py", line 705, in runfile File "E:\anaconda\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile File "F:/Ranly_Obj/AdcancedTech/auto_example.py", line 32, in File "F:/Ranly_Obj/AdcancedTech/auto_example.py", line 26, in f File "C:\Users\lenovo\AppData\Roaming\Python\Python36\site-packages\autokeras\image\image_supervised.py", line 123, in fit File "C:\Users\lenovo\AppData\Roaming\Python\Python36\site-packages\autokeras\supervised.py", line 140, in fit File "C:\Users\lenovo\AppData\Roaming\Python\Python36\site-packages\autokeras\net_module.py", line 60, in fit File "C:\Users\lenovo\AppData\Roaming\Python\Python36\site-packages\autokeras\search.py", line 238, in search File "E:\anaconda\lib\multiprocessing\process.py", line 116, in terminate AttributeError: 'NoneType' object has no attribute 'terminate' |
@EverKnows Are you using notebook to run the code? Can you provide some more detail about your environment? |
@tl-yang i use spyder to run my code
windows 10 |
When I put 46000 224 * 224 images for training ,I ran into this problem. |
@locys The exception actually may not have anything to do with the actual error. Could you provide me with the full console log? |
I have the same issue. This is my code. Almost same as example. `from keras.datasets import mnist if name == 'main':
Error message:
Initializing search. +----------------------------------------------+ File "", line 1, in File "C:\Anaconda\envs\tf_gpu\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 704, in runfile File "C:\Anaconda\envs\tf_gpu\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 108, in execfile File "E:/tm/mutlu_tm/tm_scrape/MNIST_autokeras.py", line 17, in File "C:\Anaconda\envs\tf_gpu\lib\site-packages\autokeras\image\image_supervised.py", line 114, in fit File "C:\Anaconda\envs\tf_gpu\lib\site-packages\autokeras\supervised.py", line 129, in fit File "C:\Anaconda\envs\tf_gpu\lib\site-packages\autokeras\net_module.py", line 65, in fit File "C:\Anaconda\envs\tf_gpu\lib\site-packages\autokeras\search.py", line 222, in search File "C:\Anaconda\envs\tf_gpu\lib\multiprocessing\process.py", line 116, in terminate AttributeError: 'NoneType' object has no attribute 'terminate' Setup Details OS type and version: Windows 8.1 Pro I am using conda virtual env and spyder to run the code. |
i also meet this error when i use spyder, but if i use command line to run python file, no error occur! |
I also have the same error with Django, How can I apply this solution ? |
Any update regarding the "'NoneType' object has no attribute 'terminate'" bug?? |
I found some thing about that , the issue happens if some bad object in the query set doesn't contain the mentioned attribute, if all objects are fine the issue doesn't happen , at least on Django 2 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
when i run the fit function in mnist example, raised this error:
my evironment is windows 10 ,and is strictly requested due to requirements.txt.
has someone encountered such a situation? please tell me how to solve
thank you
Traceback (most recent call last):
File "", line 1, in
File "C:\Anaconda3\lib\site-packages\autokeras-0.2.19-py3.6.egg\autokeras\search.py", line 231, in search
File "C:\Anaconda3\lib\multiprocessing\spawn.py", line 105, in spawn_main
File "C:\Anaconda3\lib\multiprocessing\process.py", line 116, in terminate
exitcode = _main(fd)
File "C:\Anaconda3\lib\multiprocessing\spawn.py", line 114, in _main
self._popen.terminate()
AttributeError: 'NoneType' object has no attribute 'terminate'
prepare(preparation_data)
File "C:\Anaconda3\lib\multiprocessing\spawn.py", line 225, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "C:\Anaconda3\lib\multiprocessing\spawn.py", line 277, in _fixup_main_from_path
run_name="mp_main")
File "C:\Anaconda3\lib\runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "C:\Anaconda3\lib\runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "C:\Anaconda3\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "D:\autokeras-master\examples\mnist.py", line 9, in
clf.fit(x_train,y_train)
File "C:\Anaconda3\lib\site-packages\autokeras-0.2.19-py3.6.egg\autokeras\image\image_supervised.py", line 159, in fit
File "C:\Anaconda3\lib\site-packages\autokeras-0.2.19-py3.6.egg\autokeras\cnn_module.py", line 50, in fit
File "C:\Anaconda3\lib\site-packages\autokeras-0.2.19-py3.6.egg\autokeras\search.py", line 231, in search
File "C:\Anaconda3\lib\multiprocessing\process.py", line 116, in terminate
self._popen.terminate()
AttributeError: 'NoneType' object has no attribute 'terminate'
The text was updated successfully, but these errors were encountered: