Relative Content

Tag Archive for tensorflow

tensorflow model.fit vs model.evaluate give conflicting results

Using tensorflow, I have a trained multi-ouput regression model so that when I run model.evaluate(X,Y) I get an accuracy of 1.0. Being suspicious of perfection, I tried model.predict(X) thinking that this should be similar to Y. This returns something that is ~55% similar to Y.

How to filter tensorflow tuple dataset?

import tensorflow as tf # Create dummy data image_data = [tf.constant([1]), tf.constant([2]), tf.constant([3])] caption_data = [tf.constant([10]), tf.constant([20]), tf.constant([30])] target_data = [tf.constant([100]), tf.constant([200]), tf.constant([300])] # Create a dataset from the dummy data dataset = tf.data.Dataset.from_tensor_slices(((image_data, caption_data), target_data)) # Define a filter function that checks a simple condition on the target tensor def filter_funct(data): ((image_tensor, caption_tensor), target_tensor) […]

Failed to load the native TensorFlow runtime ( DINet)

Traceback (most recent call last): File “inference.py”, line 1, in from utils.deep_speech import DeepSpeech File “C:UsersAhmedWdinetutilsdeep_speech.py”, line 7, in import tensorflow as tf File “C:UsersAhmedanaconda3envsdinetlibsite-packagestensorflow_init_.py”, line 99, in from tensorflow_core import * File “C:UsersAhmedanaconda3envsdinetlibsite-packagestensorflow_core_init_.py”, line 28, in from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import File “C:UsersAhmedanaconda3envsdinetlibsite-packagestensorflow_init_.py”, line 50, in getattr module = self.load() File “C:UsersAhmedanaconda3envsdinetlibsite-packagestensorflow_init.py”, line 44, in _load module = importlib.import_module(self.name) File “C:UsersAhmedanaconda3envsdinetlibimportlib_init.py”, line 127, in import_module return _bootstrap.gcd_import(name[level:], package, level) File “C:UsersAhmedanaconda3envsdinetlibsite-packagestensorflow_corepython_init.py”, line 49, in from tensorflow.python import pywrap_tensorflow File “C:UsersAhmedanaconda3envsdinetlibsite-packagestensorflow_corepythonpywrap_tensorflow.py”, line 74, in raise ImportError(msg) ImportError: Traceback (most recent call last): File “C:UsersAhmedanaconda3envsdinetlibsite-packagestensorflow_corepythonpywrap_tensorflow.py”, line 58, in from tensorflow.python.pywrap_tensorflow_internal import * File “C:UsersAhmedanaconda3envsdinetlibsite-packagestensorflow_corepythonpywrap_tensorflow_internal.py”, line 28, in _pywrap_tensorflow_internal = swig_import_helper() File “C:UsersAhmedanaconda3envsdinetlibsite-packagestensorflow_corepythonpywrap_tensorflow_internal.py”, line 24, in swig_import_helper _mod = imp.load_module(‘_pywrap_tensorflow_internal’, fp, pathname, description) File “C:UsersAhmedanaconda3envsdinetlibimp.py”, line 242, in load_module return load_dynamic(name, filename, file) File “C:UsersAhmedanaconda3envsdinetlibimp.py”, line 342, in load_dynamic return _load(spec) ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed. Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/errors for some common reasons and solutions. Include the entire stack trace above this error message when asking for help.

Unable to install tensorflow 2.16 with GPU support

I recently moved from Windows to Ubuntu 24. I tried to install the last TensorFlow with GPU support, but TensorFlow could not find the GPU. To do that, I used Miniconda and noticed I could not install CUDA 12.3. Also, I have to install 8.9, but looking at the cuDNN website, the last version of supported Ubuntu is 22 instead of the 24 I’m using. Can someone provide me with a step-by-step guide on how to install TensorFlow on Ubuntu?