How to fix this "TypeError: __init__() missing 1 required positional argument: 'deprecated_to_canonical'? - tensorflow

I am new to Tensorflow and following this tutorial please help me to fix this
I don't what's wrong i can't undarstant why this error
$ python tfml.py
Traceback (most recent call last):
File "tfml.py", line 2, in <module>
import tensorflow as tf
File "C:\Users\rkria\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\__init__.py", line 34, in <module>
from tensorflow._api.v1 import compat
File "C:\Users\rkria\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\_api\v1\compat\__init__.py", line 21, in <module>
from tensorflow._api.v1.compat import v1
File "C:\Users\rkria\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\_api\v1\compat\v1\__init__.py", line 643, in <module>
'tensorflow_estimator.python.estimator.api._v1.estimator'))
File "C:\Users\rkria\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow\python\tools\component_api_helper.py", line 56, in package_hook
child_pkg = importlib.import_module(child_package_str)
File "C:\Users\rkria\AppData\Local\Programs\Python\Python37\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\rkria\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_estimator\__init__.py", line 8, in <module>
from tensorflow_estimator._api.v1 import estimator
File "C:\Users\rkria\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_estimator\_api\v1\estimator\__init__.py", line 8, in <module>
from tensorflow_estimator._api.v1.estimator import experimental
File "C:\Users\rkria\AppData\Local\Programs\Python\Python37\lib\site-packages\tensorflow_estimator\_api\v1\estimator\experimental\__init__.py", line 29, in
<module>
_sys.modules[__name__], "estimator.experimental")
TypeError: __init__() missing 1 required positional argument: 'deprecated_to_canonical'

Related

yolov7 ImportError: DLL load failed while importing _fblas: %1 is not a Win32 application

When I start the tutorial it shows an error. I am using windows 11 64 bit. I installed all the packages through anaconda, and I can’t understand what the problem could be. (Python 3.9)
Traceback (most recent call last):
File "C:\Users\iirof\PycharmProjects\rf_detect_mob\yolov7-custom\train.py", line 24, in <module>
import test # import test.py to get mAP after each epoch
File "C:\Users\iirof\PycharmProjects\rf_detect_mob\yolov7-custom\test.py", line 12, in <module>
from models.experimental import attempt_load
File "C:\Users\iirof\PycharmProjects\rf_detect_mob\yolov7-custom\models\experimental.py", line 6, in <module>
from models.common import Conv, DWConv
File "C:\Users\iirof\PycharmProjects\rf_detect_mob\yolov7-custom\models\common.py", line 17, in <module>
from utils.plots import color_list, plot_one_box
File "C:\Users\iirof\PycharmProjects\rf_detect_mob\yolov7-custom\utils\plots.py", line 19, in <module>
from scipy.signal import butter, filtfilt
File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\signal\__init__.py", line 309, in <module>
from . import _sigtools, windows
File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\signal\windows\__init__.py", line 41, in <module>
from ._windows import *
File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\signal\windows\_windows.py", line 7, in <module>
from scipy import linalg, special, fft as sp_fft
File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\__init__.py", line 233, in __getattr__
return _importlib.import_module(f'scipy.{name}')
File "C:\Users\iirof\anaconda3\envs\rf\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\linalg\__init__.py", line 197, in <module>
from ._misc import *
File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\linalg\_misc.py", line 3, in <module>
from .blas import get_blas_funcs
File "C:\Users\iirof\anaconda3\envs\rf\lib\site-packages\scipy\linalg\blas.py", line 213, in <module>
from scipy.linalg import _fblas
ImportError: DLL load failed while importing _fblas: %1 не является приложением Win32.
Tried to install different versions of python, but nothing new.

from resource import setrlimit ModuleNotFoundError: No module named 'resource'`

tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudart64_110.dll'; dlerror: cudart64_110.dll not found
2022-04-28 10:02:39.911093: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
File "D:\ASL_to_English\Tensorflow\models\research\object_detection\builders\model_builder_tf2_test.py", line 24, in <module>
from object_detection.builders import model_builder
File "C:\Users\DELL\AppData\Roaming\Python\Python39\site-packages\object_detection\builders\model_builder.py", line 22, in <module>
from object_detection.builders import box_predictor_builder
File "C:\Users\DELL\AppData\Roaming\Python\Python39\site-packages\object_detection\builders\box_predictor_builder.py", line 20, in <module>
from object_detection.predictors import convolutional_box_predictor
File "C:\Users\DELL\AppData\Roaming\Python\Python39\site-packages\object_detection\predictors\convolutional_box_predictor.py", line 19, in <module>
from object_detection.core import box_predictor
File "C:\Users\DELL\AppData\Roaming\Python\Python39\site-packages\object_detection\core\box_predictor.py", line 137, in <module>
class KerasBoxPredictor(tf.keras.Model):
File "C:\Users\DELL\AppData\Roaming\Python\Python39\site-packages\tensorflow\python\util\lazy_loader.py", line 62, in __getattr__
module = self._load()
File "C:\Users\DELL\AppData\Roaming\Python\Python39\site-packages\tensorflow\python\util\lazy_loader.py", line 45, in _load
module = importlib.import_module(self.__name__)
File "C:\Program Files\Python39\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\DELL\AppData\Roaming\Python\Python39\site-packages\keras\api\__init__.py", line 10, in <module>
from keras.api import keras
File "C:\Users\DELL\AppData\Roaming\Python\Python39\site-packages\keras\api\keras\__init__.py", line 11, in <module>
from keras.api.keras import __internal__
File "C:\Users\DELL\AppData\Roaming\Python\Python39\site-packages\keras\api\keras\__internal__\__init__.py", line 10, in <module>
from keras.api.keras.__internal__ import legacy
File "C:\Users\DELL\AppData\Roaming\Python\Python39\site-packages\keras\api\keras\__internal__\legacy\__init__.py", line 10, in <module>
from keras.api.keras.__internal__.legacy import layers
File "C:\Users\DELL\AppData\Roaming\Python\Python39\site-packages\keras\api\keras\__internal__\legacy\layers\__init__.py", line 10, in <module>
from keras.api.keras.__internal__.legacy.layers import experimental
File "C:\Users\DELL\AppData\Roaming\Python\Python39\site-packages\keras\api\keras\__internal__\legacy\layers\experimental\__init__.py", line 15, in <module>
from tensorflow.python.util import module_wrapper as _module_wrapper
File "C:\Users\DELL\AppData\Roaming\Python\Python39\site-packages\tensorflow\python\util\module_wrapper.py", line 21, in <module>
from resource import setrlimit
ModuleNotFoundError: No module named 'resource'
while training the SSD mobile net model
I am getting this error,but I have installed "resource" in windows using pip install resource
please help me out with this error

AttributeError: module 'tensorflow.python.pywrap_tensorflow' has no attribute 'TFE_MonitoringNewCounter0'

I'm using Rasa for a chatbot project and recently completed the installation. When I try to train my bot using the 'rasa train' command, it shows me this error and I cant seem to find a way to solve it.
I've reinstalled tensorflow as suggested on another forum, but it didnt make a difference
Traceback (most recent call last):
File "c:\users\rithesh\anaconda3_update\envs\tf_gpu\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\rithesh\anaconda3_update\envs\tf_gpu\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Rithesh\Anaconda3_update\envs\tf_gpu\Scripts\rasa.exe\__main__.py", line 9, in <module>
File "c:\users\rithesh\anaconda3_update\envs\tf_gpu\lib\site-packages\rasa\__main__.py", line 69, in main
set_log_level(log_level)
File "c:\users\rithesh\anaconda3_update\envs\tf_gpu\lib\site-packages\rasa\utils\common.py", line 68, in set_log_level
update_tensorflow_log_level()
File "c:\users\rithesh\anaconda3_update\envs\tf_gpu\lib\site-packages\rasa\utils\common.py", line 87, in update_tensorflow_log_level
import tensorflow as tf
File "c:\users\rithesh\anaconda3_update\envs\tf_gpu\lib\site-packages\tensorflow\__init__.py", line 29, in <module>
from tensorflow._api.v1 import compat
File "c:\users\rithesh\anaconda3_update\envs\tf_gpu\lib\site-packages\tensorflow\_api\v1\compat\__init__.py", line 21, in <module>
from tensorflow._api.v1.compat import v1
File "c:\users\rithesh\anaconda3_update\envs\tf_gpu\lib\site-packages\tensorflow\_api\v1\compat\v1\__init__.py", line 626, in <module>
child_package_str=('tensorflow_estimator.python.estimator.api.estimator'))
File "c:\users\rithesh\anaconda3_update\envs\tf_gpu\lib\site-packages\tensorflow\python\tools\component_api_helper.py", line 56, in package_hook
child_pkg = importlib.import_module(child_package_str)
File "c:\users\rithesh\anaconda3_update\envs\tf_gpu\lib\importlib\__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "c:\users\rithesh\anaconda3_update\envs\tf_gpu\lib\site-packages\tensorflow_estimator\__init__.py", line 8, in <module>
from tensorflow_estimator._api.v1 import estimator
File "c:\users\rithesh\anaconda3_update\envs\tf_gpu\lib\site-packages\tensorflow_estimator\_api\v1\estimator\__init__.py", line 8, in <module>
from tensorflow_estimator._api.v1.estimator import experimental
File "c:\users\rithesh\anaconda3_update\envs\tf_gpu\lib\site-packages\tensorflow_estimator\_api\v1\estimator\experimental\__init__.py", line 8, in <module>
from tensorflow_estimator.python.estimator.canned.dnn import dnn_logit_fn_builder
File "c:\users\rithesh\anaconda3_update\envs\tf_gpu\lib\site-packages\tensorflow_estimator\python\estimator\__init__.py", line 25, in <module>
import tensorflow_estimator.python.estimator.estimator_lib
File "c:\users\rithesh\anaconda3_update\envs\tf_gpu\lib\site-packages\tensorflow_estimator\python\estimator\estimator_lib.py", line 22, in <module>
from tensorflow_estimator.python.estimator.canned.baseline import BaselineClassifier
File "c:\users\rithesh\anaconda3_update\envs\tf_gpu\lib\site-packages\tensorflow_estimator\python\estimator\canned\baseline.py", line 67, in <module>
from tensorflow_estimator.python.estimator import estimator
File "c:\users\rithesh\anaconda3_update\envs\tf_gpu\lib\site-packages\tensorflow_estimator\python\estimator\estimator.py", line 37, in <module>
from tensorflow.python.eager import monitoring
File "c:\users\rithesh\anaconda3_update\envs\tf_gpu\lib\site-packages\tensorflow\python\eager\monitoring.py", line 31, in <module>
create=pywrap_tensorflow.TFE_MonitoringNewCounter0,
AttributeError: module 'tensorflow.python.pywrap_tensorflow' has no attribute 'TFE_MonitoringNewCounter0'
Did you read this already?
AttributeError: module 'tensorflow.python.pywrap_tensorflow' has no attribute 'TFE_Py_RegisterExceptionClass'
In my experience a clean conda environment goes a long way. Also the order in which you type your conda install commands matters.

Tensorflow object detection API test error

I am currently trying to use models from Google, and testing object detection API, but I met with the error which stops me from processing. Here are my errors. Can anyone tell me how to solve this:
tf#tf:~/Downloads/user/huyanju/models/research$ python object_detection/builders/model_builder_test.py
Traceback (most recent call last):
File "object_detection/builders/model_builder_test.py", line 21, in <module>
from object_detection.builders import model_builder
File "/home/tf/Downloads/user/huyanju/models/research/object_detection/builders/model_builder.py", line 17, in <module>
from object_detection.builders import anchor_generator_builder
File "/home/tf/Downloads/user/huyanju/models/research/object_detection/builders/anchor_generator_builder.py", line 21, in <module>
from object_detection.protos import anchor_generator_pb2
File "/home/tf/Downloads/user/huyanju/models/research/object_detection/protos/anchor_generator_pb2.py", line 16, in <module>
from object_detection.protos import grid_anchor_generator_pb2 as object__detection_dot_protos_dot_grid__anchor__generator__pb2
File "/home/tf/Downloads/user/huyanju/models/research/object_detection/protos/grid_anchor_generator_pb2.py", line 41, in <module>
options=None, file=DESCRIPTOR),
TypeError: __new__() got an unexpected keyword argument 'file'
tf#tf:~/Downloads/user/huyanju/models/research$

Observed error while installing PDFMiner for Python2.7

I followed the instruction from here:
file:///home/bioinfo/Descargas/pdfminer3k-1.3.0/docs/index.html
after download pdfminer3k-1.3.0 I did:
python setup.py install
But when I do
pdf2txt.py samples/simple1.pdf
And it doesn't read the pdf, the path is ok.
It give me back the error:
>
Traceback (most recent call last):
File "/usr/local/bin/pdf2txt.py", line 5, in <module>
pkg_resources.run_script('pdfminer3k==1.3.0', 'pdf2txt.py')
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 528, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1394, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/EGG-INFO/scripts/pdf2txt.py", line 6, in <module>
from pdfminer.pdfinterp import PDFResourceManager, process_pdf
File "/usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/pdfinterp.py", line 5, in <module>
from .cmapdb import CMapDB, CMap
File "/usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/cmapdb.py", line 23, in <module>
from .psparser import PSStackParser
File "/usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/psparser.py", line 4, in <module>
from .utils import choplist
File "/usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/utils.py", line 212, in <module>
0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff,
File "/usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/utils.py", line 180, in <genexpr>
PDFDocEncoding = ''.join( chr(x) for x in (
ValueError: chr() arg not in range(256)
Is it any solution?
The latest code (version 20140328) uses unichr(). Try this instead:
pip install pdfminer==20140328
Or download from https://pypi.python.org/pypi/pdfminer/20140328.