I have the following error, and I am new to data science and python
I am using python, keras, tensorflow
from tensorflow.python.profiler import trace
ImportError: cannot import name 'trace'
Full error report
Training network heads
ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.
ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.
ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.
Traceback (most recent call last):
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\keras\callbacks\tensorboard_v1.py", line 96, in __init__
from tensorflow.contrib.tensorboard.plugins import projector
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_core\contrib\__init__.py", line 39, in <module>
from tensorflow.contrib import compiler
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_core\contrib\compiler\__init__.py", line 21, in <module>
from tensorflow.contrib.compiler import jit
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_core\contrib\compiler\__init__.py", line 22, in <module>
from tensorflow.contrib.compiler import xla
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_core\contrib\compiler\xla.py", line 22, in <module>
from tensorflow.python.estimator import model_fn as model_fn_lib
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_core\python\estimator\model_fn.py", line 26, in <module>
from tensorflow_estimator.python.estimator import model_fn
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_estimator\__init__.py", line 10, in <module>
from tensorflow_estimator._api.v1 import estimator
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_estimator\_api\v1\estimator\__init__.py", line 10, in <module>
from tensorflow_estimator._api.v1.estimator import experimental
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_estimator\_api\v1\estimator\experimental\__init__.py", line 10, in <module>
from tensorflow_estimator.python.estimator.canned.dnn import dnn_logit_fn_builder
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_estimator\python\estimator\canned\dnn.py", line 27, in <module>
from tensorflow_estimator.python.estimator import estimator
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 36, in <module>
from tensorflow.python.profiler import trace
ImportError: cannot import name 'trace'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\interactiveshell.py", line 3343, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-6-712e23ddfaeb>", line 8, in <module>
layers='heads')
File "F:\Khalid\Documents\miniconda3\envs\crowdai-mapping-challenge-mask-rcnn-master\crowdai-mapping-challenge-mask-rcnn-master\mrcnn\model.py", line 2287, in train
histogram_freq=0, write_graph=True, write_images=False),
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\keras\callbacks\tensorboard_v1.py", line 98, in __init__
raise ImportError('You need the TensorFlow (v1) module installed to '
ImportError: You need the TensorFlow (v1) module installed to use TensorBoard.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\interactiveshell.py", line 2044, 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 "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\ultratb.py", line 1169, in get_records
return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\ultratb.py", line 316, in wrapped
return f(*args, **kwargs)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\ultratb.py", line 350, in _fixed_getinnerframes
records = fix_frame_records_filenames(inspect.getinnerframes(etb, context))
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\inspect.py", line 1490, in getinnerframes
frameinfo = (tb.tb_frame,) + getframeinfo(tb, context)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\inspect.py", line 1448, in getframeinfo
filename = getsourcefile(frame) or getfile(frame)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\inspect.py", line 696, in getsourcefile
if getattr(getmodule(object, filename), '__loader__', None) is not None:
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\inspect.py", line 733, in getmodule
if ismodule(module) and hasattr(module, '__file__'):
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'tensorflow_core.estimator'
Traceback (most recent call last):
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\keras\callbacks\tensorboard_v1.py", line 96, in __init__
from tensorflow.contrib.tensorboard.plugins import projector
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_core\contrib\__init__.py", line 39, in <module>
from tensorflow.contrib import compiler
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_core\contrib\compiler\__init__.py", line 21, in <module>
from tensorflow.contrib.compiler import jit
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_core\contrib\compiler\__init__.py", line 22, in <module>
from tensorflow.contrib.compiler import xla
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_core\contrib\compiler\xla.py", line 22, in <module>
from tensorflow.python.estimator import model_fn as model_fn_lib
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_core\python\estimator\model_fn.py", line 26, in <module>
from tensorflow_estimator.python.estimator import model_fn
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_estimator\__init__.py", line 10, in <module>
from tensorflow_estimator._api.v1 import estimator
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_estimator\_api\v1\estimator\__init__.py", line 10, in <module>
from tensorflow_estimator._api.v1.estimator import experimental
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_estimator\_api\v1\estimator\experimental\__init__.py", line 10, in <module>
from tensorflow_estimator.python.estimator.canned.dnn import dnn_logit_fn_builder
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_estimator\python\estimator\canned\dnn.py", line 27, in <module>
from tensorflow_estimator.python.estimator import estimator
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 36, in <module>
from tensorflow.python.profiler import trace
ImportError: cannot import name 'trace'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\interactiveshell.py", line 3343, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-6-712e23ddfaeb>", line 8, in <module>
layers='heads')
File "F:\Khalid\Documents\miniconda3\envs\crowdai-mapping-challenge-mask-rcnn-master\crowdai-mapping-challenge-mask-rcnn-master\mrcnn\model.py", line 2287, in train
histogram_freq=0, write_graph=True, write_images=False),
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\keras\callbacks\tensorboard_v1.py", line 98, in __init__
raise ImportError('You need the TensorFlow (v1) module installed to '
ImportError: You need the TensorFlow (v1) module installed to use TensorBoard.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\interactiveshell.py", line 2044, 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 "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\interactiveshell.py", line 3263, in run_ast_nodes
if (await self.run_code(code, result, async_=asy)):
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\interactiveshell.py", line 3360, in run_code
self.showtraceback(running_compiled_code=True)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\interactiveshell.py", line 2047, in showtraceback
value, tb, tb_offset=tb_offset)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\ultratb.py", line 1436, in structured_traceback
self, etype, value, tb, tb_offset, number_of_lines_of_context)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\ultratb.py", line 1336, in structured_traceback
self, etype, value, tb, tb_offset, number_of_lines_of_context
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\ultratb.py", line 1193, in structured_traceback
tb_offset)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\ultratb.py", line 1150, in format_exception_as_a_whole
last_unique, recursion_repeat = find_recursion(orig_etype, evalue, records)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\ultratb.py", line 451, in find_recursion
return len(records), 0
TypeError: object of type 'NoneType' has no len()
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\interactiveshell.py", line 2044, in showtraceback
stb = value._render_traceback_()
AttributeError: 'TypeError' object has no attribute '_render_traceback_'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\ultratb.py", line 1169, in get_records
return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\ultratb.py", line 316, in wrapped
return f(*args, **kwargs)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\ultratb.py", line 350, in _fixed_getinnerframes
records = fix_frame_records_filenames(inspect.getinnerframes(etb, context))
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\inspect.py", line 1490, in getinnerframes
frameinfo = (tb.tb_frame,) + getframeinfo(tb, context)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\inspect.py", line 1448, in getframeinfo
filename = getsourcefile(frame) or getfile(frame)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\inspect.py", line 696, in getsourcefile
if getattr(getmodule(object, filename), '__loader__', None) is not None:
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\inspect.py", line 733, in getmodule
if ismodule(module) and hasattr(module, '__file__'):
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'tensorflow_core.estimator'
Traceback (most recent call last):
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\keras\callbacks\tensorboard_v1.py", line 96, in __init__
from tensorflow.contrib.tensorboard.plugins import projector
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_core\contrib\__init__.py", line 39, in <module>
from tensorflow.contrib import compiler
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_core\contrib\compiler\__init__.py", line 21, in <module>
from tensorflow.contrib.compiler import jit
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_core\contrib\compiler\__init__.py", line 22, in <module>
from tensorflow.contrib.compiler import xla
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_core\contrib\compiler\xla.py", line 22, in <module>
from tensorflow.python.estimator import model_fn as model_fn_lib
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_core\python\estimator\model_fn.py", line 26, in <module>
from tensorflow_estimator.python.estimator import model_fn
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_estimator\__init__.py", line 10, in <module>
from tensorflow_estimator._api.v1 import estimator
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_estimator\_api\v1\estimator\__init__.py", line 10, in <module>
from tensorflow_estimator._api.v1.estimator import experimental
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_estimator\_api\v1\estimator\experimental\__init__.py", line 10, in <module>
from tensorflow_estimator.python.estimator.canned.dnn import dnn_logit_fn_builder
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_estimator\python\estimator\canned\dnn.py", line 27, in <module>
from tensorflow_estimator.python.estimator import estimator
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 36, in <module>
from tensorflow.python.profiler import trace
ImportError: cannot import name 'trace'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\interactiveshell.py", line 3343, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-6-712e23ddfaeb>", line 8, in <module>
layers='heads')
File "F:\Khalid\Documents\miniconda3\envs\crowdai-mapping-challenge-mask-rcnn-master\crowdai-mapping-challenge-mask-rcnn-master\mrcnn\model.py", line 2287, in train
histogram_freq=0, write_graph=True, write_images=False),
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\keras\callbacks\tensorboard_v1.py", line 98, in __init__
raise ImportError('You need the TensorFlow (v1) module installed to '
ImportError: You need the TensorFlow (v1) module installed to use TensorBoard.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\interactiveshell.py", line 2044, 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 "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\interactiveshell.py", line 3263, in run_ast_nodes
if (await self.run_code(code, result, async_=asy)):
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\interactiveshell.py", line 3360, in run_code
self.showtraceback(running_compiled_code=True)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\interactiveshell.py", line 2047, in showtraceback
value, tb, tb_offset=tb_offset)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\ultratb.py", line 1436, in structured_traceback
self, etype, value, tb, tb_offset, number_of_lines_of_context)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\ultratb.py", line 1336, in structured_traceback
self, etype, value, tb, tb_offset, number_of_lines_of_context
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\ultratb.py", line 1193, in structured_traceback
tb_offset)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\ultratb.py", line 1150, in format_exception_as_a_whole
last_unique, recursion_repeat = find_recursion(orig_etype, evalue, records)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\ultratb.py", line 451, in find_recursion
return len(records), 0
TypeError: object of type 'NoneType' has no len()
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\interactiveshell.py", line 2044, in showtraceback
stb = value._render_traceback_()
AttributeError: 'TypeError' object has no attribute '_render_traceback_'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\interactiveshell.py", line 2895, in _run_cell
return runner(coro)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\async_helpers.py", line 68, in _pseudo_sync_runner
coro.send(None)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\interactiveshell.py", line 3072, in run_cell_async
interactivity=interactivity, compiler=compiler, result=result)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\interactiveshell.py", line 3282, in run_ast_nodes
self.showtraceback()
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\interactiveshell.py", line 2047, in showtraceback
value, tb, tb_offset=tb_offset)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\ultratb.py", line 1436, in structured_traceback
self, etype, value, tb, tb_offset, number_of_lines_of_context)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\ultratb.py", line 1336, in structured_traceback
self, etype, value, tb, tb_offset, number_of_lines_of_context
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\ultratb.py", line 1211, in structured_traceback
chained_exceptions_tb_offset)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\ultratb.py", line 1150, in format_exception_as_a_whole
last_unique, recursion_repeat = find_recursion(orig_etype, evalue, records)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\ultratb.py", line 451, in find_recursion
return len(records), 0
TypeError: object of type 'NoneType' has no len()
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\interactiveshell.py", line 2044, in showtraceback
stb = value._render_traceback_()
AttributeError: 'TypeError' object has no attribute '_render_traceback_'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\ultratb.py", line 1169, in get_records
return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\ultratb.py", line 316, in wrapped
return f(*args, **kwargs)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\IPython\core\ultratb.py", line 350, in _fixed_getinnerframes
records = fix_frame_records_filenames(inspect.getinnerframes(etb, context))
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\inspect.py", line 1490, in getinnerframes
frameinfo = (tb.tb_frame,) + getframeinfo(tb, context)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\inspect.py", line 1448, in getframeinfo
filename = getsourcefile(frame) or getfile(frame)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\inspect.py", line 696, in getsourcefile
if getattr(getmodule(object, filename), '__loader__', None) is not None:
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\inspect.py", line 733, in getmodule
if ismodule(module) and hasattr(module, '__file__'):
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow\__init__.py", line 50, in __getattr__
module = self._load()
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\site-packages\tensorflow\__init__.py", line 44, in _load
module = _importlib.import_module(self.__name__)
File "F:\Khalid\Documents\miniconda3\envs\crowdAI2\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'tensorflow_core.estimator'
Upgrade the Tensorflow version
pip install tensorflow --upgrade
In Tensorflow 2.7.0. Use
from tensorflow.profiler.experimental import Trace
how to init pyttsx3 in pydroid3
when i tried to init it is raising OSError
can anyone help to solve this code
i tried this code
import pyttsx3
engine = pyttsx3.init()
engine.say("hello world")
engine.runAndWait()
but it raised this error
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/pyttsx3/__init__.py", line 20, in init
eng = _activeEngines[driverName]
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/weakref.py", line 137, in __getitem__
o = self.data[key]()
KeyError: None
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 31, in <module> start(fakepyfile,mainpyfile)
File "/data/user/0/ru.iiec.pydroid3/files/accomp_files/iiec_run/iiec_run.py", line 30, in start
exec(open(mainpyfile).read(), __main__.__dict__)
File "<string>", line 2, in <module>
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/pyttsx3/__init__.py", line 22, in init
eng = Engine(driverName, debug)
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/pyttsx3/engine.py", line 30, in __init__
self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/pyttsx3/driver.py", line 50, in __init__
self._module = importlib.import_module(name)
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/pyttsx3/drivers/espeak.py", line 9, in <module>
from . import _espeak, toUtf8, fromUtf8
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/site-packages/pyttsx3/drivers/_espeak.py", line 18, in <module>
dll = cdll.LoadLibrary('libespeak.so.1')
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/ctypes/__init__.py", line 452, in LoadLibrary
return self._dlltype(name)
File "/data/user/0/ru.iiec.pydroid3/files/aarch64-linux-android/lib/python3.9/ctypes/__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen failed: library "libespeak.so.1" not found
how to solve this error?
do anyone knows how to solve this error?
To be honest, there is a way around this error, which is to put 'dummy' in init() inside the parentheses. It is not a big deal, since it will still not work, at least it removes the error (I say it in my case).
the title says all mostly, i'e been trying to make this package named chatterbot to work and then it shows this, i'm running ubuntu focal fossa
Full error log:
<frozen importlib._bootstrap>:219: RuntimeWarning: thinc.extra.search.Beam size changed, may indicate binary incompatibility. Expected 112 from C header, got 120 from PyObject
Traceback (most recent call last):
File "/home/arman/.local/lib/python3.8/site-packages/spacy/util.py", line 70, in get_lang_class
module = importlib.import_module(".lang.%s" % lang, "spacy")
File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/arman/.local/lib/python3.8/site-packages/spacy/lang/en/__init__.py", line 15, in <module>
from ...language import Language
File "/home/arman/.local/lib/python3.8/site-packages/spacy/language.py", line 17, in <module>
from .pipeline import DependencyParser, Tagger
File "/home/arman/.local/lib/python3.8/site-packages/spacy/pipeline/__init__.py", line 4, in <module>
from .pipes import Tagger, DependencyParser, EntityRecognizer, EntityLinker
File "pipes.pyx", line 17, in init spacy.pipeline.pipes
File "/home/arman/.local/lib/python3.8/site-packages/spacy/pipeline/functions.py", line 4, in <module>
from ..matcher import Matcher
ModuleNotFoundError: No module named 'spacy.matcher'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 4, in <module>
bot = ChatBot('Test')
File "/usr/local/lib/python3.8/dist-packages/ChatterBot-1.1.0a7-py3.8.egg/chatterbot/chatterbot.py", line 28, in __init__
File "/usr/local/lib/python3.8/dist-packages/ChatterBot-1.1.0a7-py3.8.egg/chatterbot/utils.py", line 33, in initialize_class
File "/usr/local/lib/python3.8/dist-packages/ChatterBot-1.1.0a7-py3.8.egg/chatterbot/storage/sql_storage.py", line 20, in __init__
File "/usr/local/lib/python3.8/dist-packages/ChatterBot-1.1.0a7-py3.8.egg/chatterbot/storage/storage_adapter.py", line 22, in __init__
File "/usr/local/lib/python3.8/dist-packages/ChatterBot-1.1.0a7-py3.8.egg/chatterbot/tagging.py", line 26, in __init__
File "/home/arman/.local/lib/python3.8/site-packages/spacy/__init__.py", line 27, in load
return util.load_model(name, **overrides)
File "/home/arman/.local/lib/python3.8/site-packages/spacy/util.py", line 132, in load_model
return load_model_from_link(name, **overrides)
File "/home/arman/.local/lib/python3.8/site-packages/spacy/util.py", line 149, in load_model_from_link
return cls.load(**overrides)
File "/home/arman/.local/lib/python3.8/site-packages/spacy/data/en/__init__.py", line 12, in load
return load_model_from_init_py(__file__, **overrides)
File "/home/arman/.local/lib/python3.8/site-packages/spacy/util.py", line 196, in load_model_from_init_py
return load_model_from_path(data_path, meta, **overrides)
File "/home/arman/.local/lib/python3.8/site-packages/spacy/util.py", line 166, in load_model_from_path
cls = get_lang_class(lang)
File "/home/arman/.local/lib/python3.8/site-packages/spacy/util.py", line 72, in get_lang_class
raise ImportError(Errors.E048.format(lang=lang, err=err))
ImportError: [E048] Can't import language en from spacy.lang: No module named 'spacy.matcher'
I've tried all the other solutions on the internet none of them worked, it's been so many hours i don't even remember them all please forgive me
I don't Know what just happened or what was the problem but i fixed it, in case anyone encounters the issue i'll leave it here
Get spacy from github
Install everything on the requirements file
Install spacy from source
It's fixed somehow...
While using the pyttsx3 module in my python 3.8.5 virtual environment by this code:
import pyttsx3
def speak(speak):
engine = pyttsx3.init()
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[1].id)
engine.getProperty('rate')
engine.setProperty('rate', 155)
engine.say(speak)
engine.runAndWait()
speak("Hello")
I'm getting this error on compilation of the above code:
Traceback (most recent call last):
File "D:\virtualenv\venv\lib\site-packages\pyttsx3\__init__.py", line 20, in init
eng = _activeEngines[driverName]
File "c:\users\CurrentUser\appdata\local\programs\python\python38-32\lib\weakref.py", line 131, in __getitem__
o = self.data[key]()
KeyError: None
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "d:/virtualenv/hehe.py", line 12, in <module>
speak("Hello")
File "d:/virtualenv/hehe.py", line 4, in speak
engine = pyttsx3.init()
File "D:\virtualenv\venv\lib\site-packages\pyttsx3\__init__.py", line 22, in init
eng = Engine(driverName, debug)
File "D:\virtualenv\venv\lib\site-packages\pyttsx3\engine.py", line 30, in __init__
self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
File "D:\virtualenv\venv\lib\site-packages\pyttsx3\driver.py", line 50, in __init__
self._module = importlib.import_module(name)
File "c:\users\CurrentUser\appdata\local\programs\python\python38-32\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
File "<frozen importlib._bootstrap>", line 991, in _find_and_load
File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 783, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "D:\venv\lib\site-packages\pyttsx3\drivers\sapi5.py", line 1, in <module>
import comtypes.client # Importing comtypes.client will make the gen subpackage
File "D:\virtualenv\venv\lib\site-packages\comtypes\__init__.py", line 1176, in <module>
class IPersist(IUnknown):
File "D:\virtualenv\venv\lib\site-packages\comtypes\__init__.py", line 1180, in IPersist
COMMETHOD([], HRESULT, 'GetClassID',
File "D:\virtualenv\venv\lib\site-packages\comtypes\__init__.py", line 1099, in COMMETHOD
from comtypes.automation import VARIANT
File "D:\virtualenv\venv\lib\site-packages\comtypes\automation.py", line 4, in <module>
import decimal
File "c:\users\CurrentUser\appdata\local\programs\python\python38-32\lib\decimal.py", line 3, in <module>
from _decimal import *
AttributeError: module 'numbers' has no attribute 'Number'
Everytime I run the given python code, the above error occurs and I'm using VS code as my coding IDE in Windows 10
Take the pyttsx3.init() out of the function. It is not to called repeateadly. It is to be called only once.
import pyttsx3
engine = pyttsx3.init()
def speak(word):
#set engine properties
engine.say(word)
engine.runAndWait()
speak('Speak')
This should work:
import pyttsx3
engine = pyttsx3.init()
def speak(word):
voices = engine.getProperty('voices')
engine.setProperty('voice', voices[1].id)
rate = engine.getProperty('rate')
engine.setProperty('rate', 155)
engine.say(word)
engine.runAndWait()
speak("Hello")
i was trying to get audio output using pyttsx3 in python
here is the code:
import pyttsx3
def speak(text):
engine = pyttsx3.init()
engine.say(text)
engine.runAndWait()
speak("hello world")
It is throwing handling errors which i am not able to understand:
Traceback (most recent call last):
File "C:\Users\harshit\AppData\Local\Programs\Python\Python37\lib\site-packages\pyttsx3_init_.py", line 20, in init
eng = _activeEngines[driverName]
File "C:\Users\harshit\AppData\Local\Programs\Python\Python37\lib\weakref.py", line 137, in getitem
o = self.datakey
KeyError: None
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\harshit\AppData\Local\Programs\Python\Python37\lib\site-packages\pyttsx3\drivers\sapi5.py", line 3, in <module>
from comtypes.gen import SpeechLib # comtypes
ImportError: cannot import name 'SpeechLib' from 'comtypes.gen' (C:\Users\harshit\AppData\Local\Programs\Python\Python37\lib\site-packages\comtypes\gen\__init__.py)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\harshit\AppData\Local\Programs\Python\Python37\lib\ctypes\__init__.py", line 121, in WINFUNCTYPE
return _win_functype_cache[(restype, argtypes, flags)]
KeyError: (<class 'ctypes.HRESULT'>, (<class 'comtypes.automation.tagVARIANT'>, <class 'comtypes.automation.LP_tagVARIANT'>, <class 'ctypes.c_long'>), 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:/Learning/100dayscode/python/voice.py", line 132, in <module>
speak("Hello ")
File "D:/Learning/100dayscode/python/voice.py", line 23, in speak
engine = pyttsx3.init()
File "C:\Users\harshit\AppData\Local\Programs\Python\Python37\lib\site-packages\pyttsx3\__init__.py", line 22, in init
eng = Engine(driverName, debug)
File "C:\Users\harshit\AppData\Local\Programs\Python\Python37\lib\site-packages\pyttsx3\engine.py", line 30, in __init__
self.proxy = driver.DriverProxy(weakref.proxy(self), driverName, debug)
File "C:\Users\harshit\AppData\Local\Programs\Python\Python37\lib\site-packages\pyttsx3\driver.py", line 50, in __init__
self._module = importlib.import_module(name)
File "C:\Users\harshit\AppData\Local\Programs\Python\Python37\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 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\harshit\AppData\Local\Programs\Python\Python37\lib\site-packages\pyttsx3\drivers\sapi5.py", line 6, in <module>
engine = comtypes.client.CreateObject("SAPI.SpVoice")
File "C:\Users\harshit\AppData\Local\Programs\Python\Python37\lib\site-packages\comtypes\client\__init__.py", line 250, in CreateObject
return _manage(obj, clsid, interface=interface)
File "C:\Users\harshit\AppData\Local\Programs\Python\Python37\lib\site-packages\comtypes\client\__init__.py", line 188, in _manage
obj = GetBestInterface(obj)
File "C:\Users\harshit\AppData\Local\Programs\Python\Python37\lib\site-packages\comtypes\client\__init__.py", line 110, in GetBestInterface
mod = GetModule(tlib)
File "C:\Users\harshit\AppData\Local\Programs\Python\Python37\lib\site-packages\comtypes\client\_generate.py", line 110, in GetModule
mod = _CreateWrapper(tlib, pathname)
File "C:\Users\harshit\AppData\Local\Programs\Python\Python37\lib\site-packages\comtypes\client\_generate.py", line 184, in _CreateWrapper
mod = _my_import(fullname)
File "C:\Users\harshit\AppData\Local\Programs\Python\Python37\lib\site-packages\comtypes\client\_generate.py", line 24, in _my_import
return __import__(fullname, globals(), locals(), ['DUMMY'])
File "C:\Users\harshit\AppData\Local\Programs\Python\Python37\lib\site-packages\comtypes\gen\_C866CA3A_32F7_11D2_9602_00C04F8EE628_0_5_4.py", line 365, in <module>
( ['out', 'retval'], POINTER(POINTER(ISpeechObjectTokens)), 'ObjectTokens' )),
File "C:\Users\harshit\AppData\Local\Programs\Python\Python37\lib\site-packages\comtypes\__init__.py", line 329, in __setattr__
self._make_methods(value)
File "C:\Users\harshit\AppData\Local\Programs\Python\Python37\lib\site-packages\comtypes\__init__.py", line 698, in _make_methods
prototype = WINFUNCTYPE(restype, *argtypes)
File "C:\Users\harshit\AppData\Local\Programs\Python\Python37\lib\ctypes\__init__.py", line 123, in WINFUNCTYPE
class WinFunctionType(_CFuncPtr):
TypeError: item 1 in _argtypes_ passes a union by value, which is unsupported.
Well i figured it out.
It looks like the new version of pip have conflicts with updates.
This code worked for me
python -m pip install pyttsx3==2.71