Trying to load in keras and tensorflow, I am still getting ModuleNotFoundError: No module named 'tensorflow_core.estimator' in my Anaconda Enviornment
Trying to load in keras and tensorflow, I am still getting ModuleNotFoundError: No module named 'tensorflow_core.estimator' in my Anaconda Enviornment
这是完整的错误
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3326, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-1-7a2fd3f04482>", line 24, in <module>
from sklearn.ensemble import GradientBoostingRegrssor
ImportError: cannot import name 'GradientBoostingRegrssor' from 'sklearn.ensemble' (C:\ProgramData\Anaconda3\lib\site-packages\sklearn\ensemble\__init__.py)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2040, in showtraceback
stb = value._render_traceback_()
AttributeError: 'ImportError' object has no attribute '_render_traceback_'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 1101, in get_records
return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset)
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 319, in wrapped
return f(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 353, in _fixed_getinnerframes
records = fix_frame_records_filenames(inspect.getinnerframes(etb, context))
File "C:\ProgramData\Anaconda3\lib\inspect.py", line 1502, in getinnerframes
frameinfo = (tb.tb_frame,) + getframeinfo(tb, context)
File "C:\ProgramData\Anaconda3\lib\inspect.py", line 1460, in getframeinfo
filename = getsourcefile(frame) or getfile(frame)
File "C:\ProgramData\Anaconda3\lib\inspect.py", line 696, in getsourcefile
if getattr(getmodule(object, filename), '__loader__', None) is not None:
File "C:\ProgramData\Anaconda3\lib\inspect.py", line 733, in getmodule
if ismodule(module) and hasattr(module, '__file__'):
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'tensorflow_core.estimator'
我在Anaconda 命令提示符中升级了keras 和tensorflow 的版本,这里是当前版本
我也试过重启我的内核
这里是原代码
import keras
import tensorflow as ts
from pylab import mpl, plt
from keras.models import Sequential
from keras.models import Dense
from keras.ptimizers import SGD
from keras.layers import LSTM
from keras.wrapper.scikit_learn import KerasRegressor
from statsmodels.graphics.tsaplots import plot_acf
如能帮助解决此问题,我们将不胜感激
这只是@merv评论的简单类型
from sklearn.ensemble import GradientBoostingRegressor
或
sklearn.ensemble.GradientBoostingRegressor
这是完整的错误
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3326, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-1-7a2fd3f04482>", line 24, in <module>
from sklearn.ensemble import GradientBoostingRegrssor
ImportError: cannot import name 'GradientBoostingRegrssor' from 'sklearn.ensemble' (C:\ProgramData\Anaconda3\lib\site-packages\sklearn\ensemble\__init__.py)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 2040, in showtraceback
stb = value._render_traceback_()
AttributeError: 'ImportError' object has no attribute '_render_traceback_'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 1101, in get_records
return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset)
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 319, in wrapped
return f(*args, **kwargs)
File "C:\ProgramData\Anaconda3\lib\site-packages\IPython\core\ultratb.py", line 353, in _fixed_getinnerframes
records = fix_frame_records_filenames(inspect.getinnerframes(etb, context))
File "C:\ProgramData\Anaconda3\lib\inspect.py", line 1502, in getinnerframes
frameinfo = (tb.tb_frame,) + getframeinfo(tb, context)
File "C:\ProgramData\Anaconda3\lib\inspect.py", line 1460, in getframeinfo
filename = getsourcefile(frame) or getfile(frame)
File "C:\ProgramData\Anaconda3\lib\inspect.py", line 696, in getsourcefile
if getattr(getmodule(object, filename), '__loader__', None) is not None:
File "C:\ProgramData\Anaconda3\lib\inspect.py", line 733, in getmodule
if ismodule(module) and hasattr(module, '__file__'):
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "C:\ProgramData\Anaconda3\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'tensorflow_core.estimator'
我在Anaconda 命令提示符中升级了keras 和tensorflow 的版本,这里是当前版本
我也试过重启我的内核
这里是原代码
import keras
import tensorflow as ts
from pylab import mpl, plt
from keras.models import Sequential
from keras.models import Dense
from keras.ptimizers import SGD
from keras.layers import LSTM
from keras.wrapper.scikit_learn import KerasRegressor
from statsmodels.graphics.tsaplots import plot_acf
如能帮助解决此问题,我们将不胜感激
这只是@merv评论的简单类型
from sklearn.ensemble import GradientBoostingRegressor
或
sklearn.ensemble.GradientBoostingRegressor