hyperas
hyperas copied to clipboard
The TypeError: object of type 'NoneType' has no len()
When I used the hyperas to adjust the paraments of ANN, It returns the" TypeError: object of type 'NoneType' has no len()", I don't know the cause of this problem. The train data and test data can be used in kreas.
......... Hyperas search space:
def get_space(): return { 'Dense': hp.choice('Dense', [40, 80, 150]), 'Dense_1': hp.choice('Dense_1', [40, 80, 150]), 'Dense_2': hp.choice('Dense_2', [40, 80, 150]), 'Dense_3': hp.choice('Dense_3', [40, 80, 150]), 'Dense_4': hp.choice('Dense_4', [40, 80, 150]), 'Dense_5': hp.choice('Dense_5', [40, 80, 150]), 'Dense_6': hp.choice('Dense_6', [40, 80, 150]), 'epochs': hp.choice('epochs', [25, 50, 75, 100]), 'batch_size': hp.choice('batch_size', [100, 300, 500 ,700]), }
Traceback (most recent call last):
File "
File "C:\Users\Ding\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile execfile(filename, namespace)
File "C:\Users\Ding\Anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 110, in execfile exec(compile(f.read(), filename, 'exec'), namespace)
File "F:/Project/machine learning assistes detecing coherence/data/datahighfideCl1/demo/Superadjustpara.py", line 70, in
File "C:\Users\Ding\Anaconda3\lib\site-packages\hyperas\optim.py", line 69, in minimize keep_temp=keep_temp)
File "C:\Users\Ding\Anaconda3\lib\site-packages\hyperas\optim.py", line 98, in base_minimizer model_str = get_hyperopt_model_string(model, data, functions, notebook_name, verbose, stack)
File "C:\Users\Ding\Anaconda3\lib\site-packages\hyperas\optim.py", line 215, in get_hyperopt_model_string data_string = retrieve_data_string(data, verbose)
File "C:\Users\Ding\Anaconda3\lib\site-packages\hyperas\optim.py", line 175, in retrieve_data_string indent_length = len(determine_indent(data_string))
TypeError: object of type 'NoneType' has no len()
Thank you
Hello everyone, when I run a program that can be executed successfully, I found that :len(determine_indent(data_string))=4, the type of "determine_indent(data_string)" is "str",and I run my program ,it returns error,and the type of "determine_indent(data_string)" is NoneType
I made a change that I set len(determine_indent(data_string)) =4, because of my the length of the indent of function "data()" is 4, My program is already running, but where is the original question of its
Hi did you solve this error ?
Hi did you solve this error ?
Yes, I already solved it, please see the last comment.
https://github.com/maxpumperla/hyperas/issues/57#issuecomment-571884491