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.
tensorflow 2.16.1 unable to locate tensorflow.keras.losses
i tried to use
How can I avoid running out of memory when I try to revert to an earlier model when training with Tensorflow
Currently, when I’m training a net it will find a region where its learning step is too large, resulting in losses that are either NaN
or Inf
. Sometimes I can train for 100’s of epochs without this ever happening, sometimes it happens after 50-100 epochs.
Resizing images uisng tensorflow.resize
Can anybody help me why I get an error when resizing using a function instead of line by line code?
Thanks
Constant identical weight and bias initialisation gives different weights for each neuron of the network
I have read in the notes on some website, as well as in other resources that if the network is intialzed with constant identical weights, then each neuron learns the same weights.
However, when I did the same in tensorflow, i am getting different weights after training for each neuron.
I am following this tutorial
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.
I have python and tensorflow installed on my system, but still getting ModuleNotFoundError
I am using windows operating system and have following versions of python and tensorflow, but still my code doesn’t work.
How to fix tensorflow “hanging”/buffering fitting error?
I have been struggling to get my tf code to run at all ever since it randomly started buffering indefinitely. Decided to build a super simple LSTM to fix this error, here is my code:
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?