Error importing pmdarima.arima library in Python - python

Can someone help me resolve the following error message when trying to import the pmdarima.arima library for Python?
ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.
Traceback (most recent call last):
File "/Users/jdoe/anaconda3/lib/python3.6/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-6858fadc5169>", line 1, in <module>
from pmdarima.arima import auto_arima
File "/Users/jdoe/anaconda3/lib/python3.6/site-packages/pmdarima/__init__.py", line 45, in <module>
from .arima import auto_arima, ARIMA, AutoARIMA
File "/Users/jdoe/anaconda3/lib/python3.6/site-packages/pmdarima/arima/__init__.py", line 6, in <module>
from .arima import *
File "/Users/jdoe/anaconda3/lib/python3.6/site-packages/pmdarima/arima/arima.py", line 10, in <module>
from sklearn.metrics import mean_absolute_error, mean_squared_error
File "/Users/jdoe/anaconda3/lib/python3.6/site-packages/sklearn/metrics/__init__.py", line 7, in <module>
from .ranking import auc
File "/Users/jdoe/anaconda3/lib/python3.6/site-packages/sklearn/metrics/ranking.py", line 35, in <module>
from ..preprocessing import label_binarize
File "/Users/jdoe/anaconda3/lib/python3.6/site-packages/sklearn/preprocessing/__init__.py", line 6, in <module>
from ._function_transformer import FunctionTransformer
File "/Users/jdoe/anaconda3/lib/python3.6/site-packages/sklearn/preprocessing/_function_transformer.py", line 5, in <module>
from ..utils.testing import assert_allclose_dense_sparse
File "/Users/jdoe/anaconda3/lib/python3.6/site-packages/sklearn/utils/testing.py", line 718, in <module>
import pytest
File "/Users/jdoe/anaconda3/lib/python3.6/site-packages/pytest.py", line 13, in <module>
from _pytest.fixtures import fixture, yield_fixture
File "/Users/jdoe/anaconda3/lib/python3.6/site-packages/_pytest/fixtures.py", line 842, in <module>
class FixtureFunctionMarker(object):
File "/Users/jdoe/anaconda3/lib/python3.6/site-packages/_pytest/fixtures.py", line 844, in FixtureFunctionMarker
params = attr.ib(convert=attr.converters.optional(tuple))
TypeError: attrib() got an unexpected keyword argument 'convert'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/jdoe/anaconda3/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2040, 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 "/Users/jdoe/anaconda3/lib/python3.6/site-packages/IPython/core/ultratb.py", line 1101, in get_records
return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset)
File "/Users/jdoe/anaconda3/lib/python3.6/site-packages/IPython/core/ultratb.py", line 319, in wrapped
return f(*args, **kwargs)
File "/Users/jdoe/anaconda3/lib/python3.6/site-packages/IPython/core/ultratb.py", line 353, in _fixed_getinnerframes
records = fix_frame_records_filenames(inspect.getinnerframes(etb, context))
File "/Users/jdoe/anaconda3/lib/python3.6/inspect.py", line 1490, in getinnerframes
frameinfo = (tb.tb_frame,) + getframeinfo(tb, context)
File "/Users/jdoe/anaconda3/lib/python3.6/inspect.py", line 1448, in getframeinfo
filename = getsourcefile(frame) or getfile(frame)
File "/Users/jdoe/anaconda3/lib/python3.6/inspect.py", line 696, in getsourcefile
if getattr(getmodule(object, filename), '__loader__', None) is not None:
File "/Users/jdoe/anaconda3/lib/python3.6/inspect.py", line 733, in getmodule
if ismodule(module) and hasattr(module, '__file__'):
File "/Users/jdoe/anaconda3/lib/python3.6/site-packages/py/_vendored_packages/apipkg.py", line 195, in __getattribute__
return getattr(getmod(), name)
File "/Users/jdoe/anaconda3/lib/python3.6/site-packages/py/_vendored_packages/apipkg.py", line 179, in getmod
x = importobj(modpath, None)
File "/Users/jdoe/anaconda3/lib/python3.6/site-packages/py/_vendored_packages/apipkg.py", line 69, in importobj
module = __import__(modpath, None, None, ['__doc__'])
File "/Users/jdoe/anaconda3/lib/python3.6/site-packages/pytest.py", line 13, in <module>
from _pytest.fixtures import fixture, yield_fixture
File "/Users/jdoe/anaconda3/lib/python3.6/site-packages/_pytest/fixtures.py", line 842, in <module>
class FixtureFunctionMarker(object):
File "/Users/jdoe/anaconda3/lib/python3.6/site-packages/_pytest/fixtures.py", line 844, in FixtureFunctionMarker
params = attr.ib(convert=attr.converters.optional(tuple))
TypeError: attrib() got an unexpected keyword argument 'convert'

I searched up the type error that appears at the end, which led me to a related StackOverflow question whose answer suggested an outdated version of pytest would cause issues. I've since upgraded my version of pytest which resolved my issue.

Related

Why is the pyspider module failing with"'collections' has no attribute 'MutableMapping'"?

After Pycharm installs pyspider,enter "pyspider all" on command,and an error is reported. C:
C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pyspider\libs\utils.py:196: FutureWarning: timeout is not supported on your platform.
warnings.warn("timeout is not supported on your platform.", FutureWarning)
[I 220529 09:16:16 result_worker:49] result_worker starting...
Exception in thread Thread-4 (invoke):
Traceback (most recent call last):
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1009, in _bootstrap_inner
self.run()
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\threading.py", line 946, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\click\decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pyspider\run.py", line 236, in fetcher
Fetcher = load_cls(None, None, fetcher_cls)
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pyspider\run.py", line 48, in load_cls
return utils.load_object(value)
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pyspider\libs\utils.py", line 369, in load_object
module = __import__(module_name, globals(), locals(), [object_name])
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pyspider\fetcher\__init__.py", line 1, in <module>
from .tornado_fetcher import Fetcher
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\pyspider\fetcher\tornado_fetcher.py", line 21, in <module>
import tornado.httputil
File "C:\Users\admin\AppData\Local\Programs\Python\Python310\lib\site-packages\tornado\httputil.py", line 106, in <module>
class HTTPHeaders(collections.MutableMapping):
AttributeError: module 'collections' has no attribute 'MutableMapping'
How to solve this situation?

why it can't import trace in python

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

AttributeError while loading saved model in tensorflow format into keras

I have some issues while trying to load saved models back into keras. Saving the model goes fine:
In [6]: model.save('savefile', save_format='tf')
INFO:tensorflow:Assets written to: savefile/assets
But when loading the model, I got the following error:
In [7]: tf.keras.models.load_model('savefile')
ERROR:root:Internal Python error in the inspect module.
Below is the traceback from this internal error.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/IPython/core/interactiveshell.py", line 2881, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-7-ddb252fa0c51>", line 1, in <module>
tf.keras.models.load_model('lofasz.xx')
File "/usr/local/lib/python3.5/dist-packages/tensorflow_core/python/keras/saving/save.py", line 190, in load_model
return saved_model_load.load(filepath, compile)
File "/usr/local/lib/python3.5/dist-packages/tensorflow_core/python/keras/saving/saved_model/load.py", line 105, in load
model = tf_load.load_internal(path, loader_cls=KerasObjectLoader)
File "/usr/local/lib/python3.5/dist-packages/tensorflow_core/python/saved_model/load.py", line 599, in load_internal
export_dir)
File "/usr/local/lib/python3.5/dist-packages/tensorflow_core/python/keras/saving/saved_model/load.py", line 170, in __init__
super(KerasObjectLoader, self).__init__(*args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/tensorflow_core/python/saved_model/load.py", line 122, in __init__
self._load_all()
File "/usr/local/lib/python3.5/dist-packages/tensorflow_core/python/keras/saving/saved_model/load.py", line 183, in _load_all
self._finalize_objects()
File "/usr/local/lib/python3.5/dist-packages/tensorflow_core/python/keras/saving/saved_model/load.py", line 394, in _finalize_objects
self._reconstruct_all_models()
File "/usr/local/lib/python3.5/dist-packages/tensorflow_core/python/keras/saving/saved_model/load.py", line 412, in _reconstruct_all_models
self._reconstruct_model(model_id, model, layers)
File "/usr/local/lib/python3.5/dist-packages/tensorflow_core/python/keras/saving/saved_model/load.py", line 442, in _reconstruct_model
model._set_inputs(input_shape) # pylint: disable=protected-access
File "/usr/local/lib/python3.5/dist-packages/tensorflow_core/python/keras/engine/training.py", line 2448, in _set_inputs
inputs = self._set_input_attrs(inputs)
File "/usr/local/lib/python3.5/dist-packages/tensorflow_core/python/training/tracking/base.py", line 456, in _method_wrapper
result = method(self, *args, **kwargs)
File "/usr/local/lib/python3.5/dist-packages/tensorflow_core/python/keras/engine/training.py", line 2487, in _set_input_attrs
input_shape = (None,) + tuple(inputs.shape[1:])
AttributeError: 'list' object has no attribute 'shape'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/IPython/core/interactiveshell.py", line 1821, in showtraceback
stb = value._render_traceback_()
AttributeError: 'AttributeError' object has no attribute '_render_traceback_'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/IPython/core/ultratb.py", line 1132, in get_records
return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset)
File "/usr/lib/python3/dist-packages/IPython/core/ultratb.py", line 313, in wrapped
return f(*args, **kwargs)
File "/usr/lib/python3/dist-packages/IPython/core/ultratb.py", line 358, in _fixed_getinnerframes
records = fix_frame_records_filenames(inspect.getinnerframes(etb, context))
File "/usr/lib/python3.5/inspect.py", line 1454, in getinnerframes
frameinfo = (tb.tb_frame,) + getframeinfo(tb, context)
File "/usr/lib/python3.5/inspect.py", line 1411, in getframeinfo
filename = getsourcefile(frame) or getfile(frame)
File "/usr/lib/python3.5/inspect.py", line 671, in getsourcefile
if getattr(getmodule(object, filename), '__loader__', None) is not None:
File "/usr/lib/python3.5/inspect.py", line 717, in getmodule
os.path.realpath(f)] = module.__name__
AttributeError: module has no attribute '__name__'
---------------------------------------------------------------------------
Loading with tf.saved_model.load does work:
In [9]: qq=tf.saved_model.load('savefile')
In [10]: qq
Out[10]: <tensorflow.python.saved_model.load.Loader._recreate_base_user_object.<locals>._UserObject at 0x7fdff155feb8>
but I didn't find anything on how to get this back as a keras model. Any ideas?

Using PyGreSQL: 'bytes' object has no attribute 'encode'

I'm trying to import PyGreSQL in Python. I've successfully installed it with pip, and also have GLFW3 installed, but I run into the following error when I import
>>> import pg
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "//anaconda/lib/py
thon3.5/site-packages/pg/__init__.py", line 1, in <module>
from .core import (
File "//anaconda/lib/python3.5/site-packages/pg/core.py", line 6, in <module>
from . import glfw
File "//anaconda/lib/python3.5/site-packages/pg/glfw.py", line 138, in <module>
['', '/usr/lib', '/usr/local/lib'], _glfw_get_version)
File "//anaconda/lib/python3.5/site-packages/pg/glfw.py", line 74, in _load_library
version = version_check_callback(filename)
File "//anaconda/lib/python3.5/site-packages/pg/glfw.py", line 130, in _glfw_get_version
out = process.communicate(_to_char_p(filename))[0]
File "//anaconda/lib/python3.5/subprocess.py", line 801, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "//anaconda/lib/python3.5/subprocess.py", line 1428, in _communicate
self._save_input(input)
File "//anaconda/lib/python3.5/subprocess.py", line 1501, in _save_input
self._input = self._input.encode(self.stdin.encoding)
AttributeError: 'bytes' object has no attribute 'encode'>>> import pg
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "//anaconda/lib/python3.5/site-packages/pg/__init__.py", line 1, in <module>
from .core import (
File "//anaconda/lib/python3.5/site-packages/pg/core.py", line 6, in <module>
from . import glfw
File "//anaconda/lib/python3.5/site-packages/pg/glfw.py", line 138, in <module>
['', '/usr/lib', '/usr/local/lib'], _glfw_get_version)
File "//anaconda/lib/python3.5/site-packages/pg/glfw.py", line 74, in _load_library
version = version_check_callback(filename)
File "//anaconda/lib/python3.5/site-packages/pg/glfw.py", line 130, in _glfw_get_version
out = process.communicate(_to_char_p(filename))[0]
File "//anaconda/lib/python3.5/subprocess.py", line 801, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "//anaconda/lib/python3.5/subprocess.py", line 1428, in _communicate
self._save_input(input)
File "//anaconda/lib/python3.5/subprocess.py", line 1501, in _save_input
self._input = self._input.encode(self.stdin.encoding)
AttributeError: 'bytes' object has no attribute 'encode'
What can I do to fix this and get PyGreSQL working?

Can't install Tensorflow, receiving both numpy and a TypeError: unsupported callable errors

I recently tried to install Tensorflow, following the instructions in their tutorial. While the installation itself worked fine, when I tried to import it, I got this:
>>> import tensorflow as tf
Traceback (most recent call last):
File "/usr/lib/python3.4/inspect.py", line 977, in getfullargspec
skip_bound_arg=False)
File "/usr/lib/python3.4/inspect.py", line 1957, in _signature_internal
skip_bound_arg=skip_bound_arg)
File "/usr/lib/python3.4/inspect.py", line 1890, in _signature_from_builtin
raise ValueError("no signature found for builtin {!r}".format(func))
ValueError: no signature found for builtin <method 'max' of 'numpy.ndarray' objects>
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.4/dist-packages/tensorflow/__init__.py", line 23, in <module>
from tensorflow.python import *
File "/usr/local/lib/python3.4/dist-packages/tensorflow/python/__init__.py", line 62, in <module>
import tensorflow.contrib as contrib
File "/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/__init__.py", line 26, in <module>
from tensorflow.contrib import learn
File "/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/learn/__init__.py", line 20, in <module>
from tensorflow.contrib.learn.python.learn import *
File "/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/learn/python/__init__.py", line 20, in <module>
from tensorflow.contrib.learn.python.learn import *
File "/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/learn/python/learn/__init__.py", line 22, in <module>
from tensorflow.contrib.learn.python.learn.io import *
File "/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/learn/python/learn/io/__init__.py", line 20, in <module>
from tensorflow.contrib.learn.python.learn.io.dask_io import *
File "/usr/local/lib/python3.4/dist-packages/tensorflow/contrib/learn/python/learn/io/dask_io.py", line 23, in <module>
import dask.dataframe as dd
File "/usr/local/lib/python3.4/dist-packages/dask/dataframe/__init__.py", line 1, in <module>
from .core import (DataFrame, Series, Index, _Frame, map_partitions,
File "/usr/local/lib/python3.4/dist-packages/dask/dataframe/core.py", line 1252, in <module>
class Index(Series):
File "/usr/local/lib/python3.4/dist-packages/dask/dataframe/core.py", line 1284, in Index
#derived_from(pd.Index)
File "/usr/local/lib/python3.4/dist-packages/dask/utils.py", line 530, in wrapper
original_args = getargspec(original_method).args
File "/usr/local/lib/python3.4/dist-packages/dask/compatibility.py", line 222, in getargspec
return _getargspec(func)
File "/usr/local/lib/python3.4/dist-packages/dask/compatibility.py", line 44, in _getargspec
return inspect.getfullargspec(func)
File "/usr/lib/python3.4/inspect.py", line 983, in getfullargspec
raise TypeError('unsupported callable') from ex
TypeError: unsupported callable
And after uninstalling it, updating Protobuf and pip, and re-installing multiple times, I still get this same error. What could be the problem?

Categories

Resources