undefined symbol: _ZN10tensorflow8OpKernel11TraceStringEPNS_15OpKernelContextEb - python-3.x

I'm getting the error below:
/usr/bin/python3.6 /home/daya/Deep_Learning/Keras-Tuner/HiddenLayersAndHiddenNeurons.py
2020-12-22 09:42:14.472136: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0
Traceback (most recent call last):
File "/home/daya/Deep_Learning/Keras-Tuner/HiddenLayersAndHiddenNeurons.py", line 2, in <module>
from tensorflow import keras
File "/home/daya/.local/lib/python3.6/site-packages/tensorflow/__init__.py", line 435, in <module>
_ll.load_library(_main_dir)
File "/home/daya/.local/lib/python3.6/site-packages/tensorflow/python/framework/load_library.py", line 153, in load_library
py_tf.TF_LoadLibrary(lib)
tensorflow.python.framework.errors_impl.NotFoundError: /usr/local/lib/python3.6/dist-packages/tensorflow/core/kernels/libtfkernel_sobol_op.so: undefined symbol: _ZN10tensorflow8OpKernel11TraceStringEPNS_15OpKernelContextEb
System config:
Ubuntu 18.04,
cuda11.1 cudnn8,
GTX 1660,
Tensorflow-gpu 2.4

In case this is an issue for you and downgrading Tensorflow is not an option, here is a hack:
delete tensorflow/core/kernels/libtfkernel_sobol_op.so altogether. This operator is a special purpose op in classic computer version for edge extraction and for 99.99% of the use cases of TF (training DNN) you won't need this operator.

Looks like it is the following issue (same symbol _ZN10tensorflow8OpKernel11TraceStringEPNS_15OpKernelContextEb is missing): https://github.com/tensorflow/text/issues/385
Did you try to update Tensorflow?

Related

AttributeError: module 'distutils' has no attribute 'version'

I can't get analytics output from tensorboard
pytorch version == 1.9.0,
tensorboard version == 2.6.0
Traceback (most recent call last):
File "optim.py", line 7, in <module>
from torch.utils.tensorboard import SummaryWriter
File "/root/miniconda3/envs/score-denoise/lib/python3.8/site-packages/torch/utils/tensorboard/__init__.py", line 4, in <module>
LooseVersion = distutils.version.LooseVersion
AttributeError: module 'distutils' has no attribute 'version'
I found a project that uses exactly these versions of libraries, installed them, but it didn't start working, how to solve this problem?
I found this link with a similar problem, but I didn't find a solution to it. https://github.com/pytorch/pytorch/issues/69894
What exactly did you do? Did you do this?
pip install setuptools==59.5.0
If yes, did the error change?

Installation of numpy through Anaconda

getting up to speed on Anaconda, I keep receiving an error message when I try to import 'numpy' into Python.
Here is what I have done so far:
Downloaded anaconda from anaconda.com (64-Bit Graphical
Installer (466 MB) with Python 3.7 for Windows);
Installed anaconda (under C:\Users\'Username'\Anaconda3 | Option 'Register Anaconda3 as my default Python 3.7')
Now I'm trying to import numpy into Python using idle.exe, which produces following error message:
Warning: os.path.expanduser("~") points to
h:\,
but the path does not exist.
Futhermore, after executing "'import 'numpy;" in IDLE I get the following error message.
Unfortunately none of the advice was helpful. Numpy seems to be properly installed.
Warning (from warnings module): File "C:\Users\'Username'\Anaconda3\lib\site-
packages\numpy\__init__.py", line 140
from . import _distributor_init
UserWarning: mkl-service package failed to import, therefore Intel(R) MKL
initialization ensuring its correct out-of-the box operation under condition
when Gnu OpenMP had already been loaded by Python process is not assured.
Please install mkl-service package, see http://github.com/IntelPython/mkl-
service
Traceback (most recent call last):
File "C:\Users\'Username'\Anaconda3\lib\site-packages\numpy\core\__init__.py",
line 24, in <module>
from . import multiarray
File "C:\Users\'Username'\Anaconda3\lib\site-packages\numpy\core\multiarray.py",
line 14, in <module>
from . import overrides
File "C:\Users\'Username'\Anaconda3\lib\site-packages\numpy\core\overrides.py",
line 7, in <module>
from numpy.core._multiarray_umath import (
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\'Username'\Anaconda3\Scripts\myscripts\import_test.py", line 1,
in <module>
import numpy
File "C:\Users\'Username'\Anaconda3\lib\site-packages\numpy\__init__.py", line
142, in <module>
from . import core
File "C:\Users\'Username'\Anaconda3\lib\site-packages\numpy\core\__init__.py",
line 54, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy c-extensions failed.
- Try uninstalling and reinstalling numpy.
- If you have already done that, then:
1. Check that you expected to use Python3.7 from
"C:\Users\'Username'\Anaconda3\python.exe",
and that you have no directories in your PATH or PYTHONPATH that can
interfere with the Python and numpy version "1.18.1" you're trying to use.
2. If (1) looks fine, you can open a new issue at
https://github.com/numpy/numpy/issues. Please include details on:
- how you installed Python
- how you installed numpy
- your operating system
- whether or not you have multiple versions of Python installed
- if you built from source, your compiler versions and ideally a build log
- If you're working with a numpy git repository, try `git clean -xdf`
(removes all files not under version control) and rebuild numpy.
Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.
Original error was: DLL load failed: The specified module could not be found.
Many thanks in advance for any help and suggestions.

ModuleNotFoundError: No module named 'tensorflow.tools.graph_transforms' when using export_tflite_ssd_graph.py

I am trying to convert a saved_model from TensorFlow Object Detection Model Zoo to a tflite file. The model I am using is ssd_mobilenet_v2_oid_v4_2018_12_12.
So I used export_tflite_ssd_graph.py:
D:\TensorFlow\models\research\object_detection>python export_tflite_ssd_graph.py
--pipeline_config_path=D:\Models\ssd_mobilenet_v2_oid_v4_2018_12_12\pipeline.config
--trained_checkpoint_prefix=D:\Models\ssd_mobilenet_v2_oid_v4_2018_12_12\model.ckpt.data-00000-of-00001
--output_directory=D:\Models
--add_postprocessing_op=true
I get the following error
2020-01-20 19:43:36.765263: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found
2020-01-20 19:43:36.770058: 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 "export_tflite_ssd_graph.py", line 96, in <module>
from object_detection import export_tflite_ssd_graph_lib
File "C:\Users\Bhavin\AppData\Local\Programs\Python\Python36\lib\site-packages\object_detection-0.1-py3.6.egg\object_detection\export_tflite_ssd_graph_lib.py", line 26, in <module>
from tensorflow.tools.graph_transforms import TransformGraph
ModuleNotFoundError: No module named 'tensorflow.tools.graph_transforms'
I tried upgrading tensorflow with pip but I still get the same error.
I am using Windows 10 and TensorFlow 2.1.0.
Facing same problem.
Ad hoc fix is downgrade to tf 1.15.0

TensorFlow-GPU 1.12.0 + CUDA 9 + cuDNN 7.41 on Windows throws DLL load failed. Same bundle works on Ubuntu

As in title I have
CUDA 9.0.176
cuDNN v7.4.1
TF-GPU 1.12
Python 3.6.6
I can confirm that path both to bin/lib for CUDA is in a PATH and also there is a path to cuda folder (not sure why if same files were copieed to CUDA folder (nvidia not a custom one as per tutorials)).
import tensorflow
>>> import tensorflow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "D:\OtherCode\Teest1\test1\lib\site-
packages\tensorflow\__init__.py", line 22, in <module>
from tensorflow.python import pywrap_tensorflow # pylint:
disable=unused-import
File "D:\OtherCode\Teest1\test1\lib\site-
packages\tensorflow\python\__init__.py", line 52, in <module>
from tensorflow.core.framework.graph_pb2 import *
File "D:\OtherCode\Teest1\test1\lib\site-
packages\tensorflow\core\framework\graph_pb2.py", line 6, in <module>
from google.protobuf import descriptor as _descriptor
File "D:\OtherCode\Teest1\test1\lib\site-
packages\google\protobuf\descriptor.py", line 47, in <module>
from google.protobuf.pyext import _message
ImportError: DLL load failed: The specified procedure could not be found.
I've tried pretty much many other different bundles after that (using Tensorflow table showing tested configurations), but none of them works.
I have all files in System32 that I've found info about, I have VS 2017 / 2019 + install the compile for 2015.
Nothing works.
Is there anything on Windows that I need to be aware of ?
Same bundle works fine on Ubuntu pretty much instantly, on Windows it fails terribly.
I would prefer use windows as there is number of issues with ubuntu (most of hardware is not supported on Ubuntu + I am using VS Studio for most of the projects).
I've tried CUDA 8.0, CUDA 9.0, CUDA 9.2, CUDA 10 (with different cuDNN for specific version + different tensorflows according to the table, however it looks like there is something else missing).
Unfortunately for some reason this combo won't work.
Other with CUDA 10 worked.

TypeError: Using a `tf.Tensor` as a Python `bool` is not allowed

I want to use the Tensorflow and TFLearn libraries in my Python 3.5 code. I have installed both using pip. I have the following versions:
tensorflow 0.12.0rc0
tflearn 0.2.1
python 3.5.2
conda 4.2.13
However, when running some code, I get the following error:
TypeError: Using a `tf.Tensor` as a Python `bool` is not allowed.
From what I can tell from this issue on GitHub, this issue should be resolved already.
How can I fix this?
EDIT: Here is the full stack trace:
Traceback (most recent call last):
File "test.py", line 35, in <module>
agent = DQNAgent(create_mlp, n_actions, env.observation_space.shape, min_replay_size=10000, batch_size=64)
File "agents.py", line 86, in __init__
self.q_net = network_fn(self.s, self._n_actions)
File "test.py", line 23, in create_mlp
net = nn.input_data(placeholder=inputs)
File "//anaconda/lib/python3.5/site-packages/tflearn/layers/core.py", line 55, in input_data
if not shape and not placeholder:
File "//anaconda/lib/python3.5/site-packages/tensorflow/python/framework/ops.py", line 533, in __bool__
raise TypeError("Using a `tf.Tensor` as a Python `bool` is not allowed. "
This bug is caused by the tflearn v0.2.1 library. The way to resolve this error is by installing the newest version via git:
pip install git+https://github.com/tflearn/tflearn.git
This will install tflearn v0.2.2, in which this bug no longer occurs.

Resources