Closed Joish closed 6 years ago
found the error:
I didn't call the function..
Change this
classfier = KerasClassifier(build_fn=func1(),batch_size=10, epochs=100)
to
classfier = KerasClassifier(build_fn=func1,batch_size=10, epochs=100)
totally my bad
ERROR: Traceback (most recent call last):
File "", line 1, in
cross = cross_val_score(estimator=classfier, X=Xtrain, y=Ytrain, cv=10 , n_jobs=-1)
File "C:\Users\Joish\Anaconda3\envs\project\lib\site-packages\sklearn\model_selection_validation.py", line 342, in cross_val_score pre_dispatch=pre_dispatch)
File "C:\Users\Joish\Anaconda3\envs\project\lib\site-packages\sklearn\model_selection_validation.py", line 206, in cross_validate for train, test in cv.split(X, y, groups))
File "C:\Users\Joish\Anaconda3\envs\project\lib\site-packages\sklearn\externals\joblib\parallel.py", line 779, in call while self.dispatch_one_batch(iterator):
File "C:\Users\Joish\Anaconda3\envs\project\lib\site-packages\sklearn\externals\joblib\parallel.py", line 620, in dispatch_one_batch tasks = BatchedCalls(itertools.islice(iterator, batch_size))
File "C:\Users\Joish\Anaconda3\envs\project\lib\site-packages\sklearn\externals\joblib\parallel.py", line 127, in init self.items = list(iterator_slice)
File "C:\Users\Joish\Anaconda3\envs\project\lib\site-packages\sklearn\model_selection_validation.py", line 206, in
for train, test in cv.split(X, y, groups))
File "C:\Users\Joish\Anaconda3\envs\project\lib\site-packages\sklearn\base.py", line 62, in clone new_object_params[name] = clone(param, safe=False)
File "C:\Users\Joish\Anaconda3\envs\project\lib\site-packages\sklearn\base.py", line 53, in clone return copy.deepcopy(estimator)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 180, in deepcopy y = _reconstruct(x, memo, *rv)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 280, in _reconstruct state = deepcopy(state, memo)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 150, in deepcopy y = copier(x, memo)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 240, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 150, in deepcopy y = copier(x, memo)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 215, in _deepcopy_list append(deepcopy(a, memo))
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 180, in deepcopy y = _reconstruct(x, memo, *rv)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 280, in _reconstruct state = deepcopy(state, memo)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 150, in deepcopy y = copier(x, memo)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 240, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 150, in deepcopy y = copier(x, memo)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 215, in _deepcopy_list append(deepcopy(a, memo))
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 180, in deepcopy y = _reconstruct(x, memo, *rv)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 280, in _reconstruct state = deepcopy(state, memo)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 150, in deepcopy y = copier(x, memo)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 240, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 180, in deepcopy y = _reconstruct(x, memo, *rv)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 280, in _reconstruct state = deepcopy(state, memo)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 150, in deepcopy y = copier(x, memo)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 240, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 180, in deepcopy y = _reconstruct(x, memo, *rv)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 280, in _reconstruct state = deepcopy(state, memo)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 150, in deepcopy y = copier(x, memo)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 240, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 180, in deepcopy y = _reconstruct(x, memo, *rv)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 280, in _reconstruct state = deepcopy(state, memo)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 150, in deepcopy y = copier(x, memo)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 240, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo)
File "C:\Users\Joish\Anaconda3\envs\project\lib\copy.py", line 169, in deepcopy rv = reductor(4)
TypeError: can't pickle _thread.lock objects
What is error and how do i solve it????