I am using an LSTM model in Keras. During the fitting stage, I added the validation_data paramater. When I plot my training vs validation loss, it seems there are major overfitting issues. My validation loss just won’t decrease. My full data is a sequence with shape [50,]. The first 20 records are used as training ..
I have Two Loop, in the second loop i have a @tf.function, I need update the value of the mutable_variable T2 times, than return the value to 0 and repeat it T1 times. My problem is that the code is very slow. Even the operation in mutable_variable is very simple. for x in range T1: ..
The input is: a = tf.constant([[[1, 2], [3, 4]], [[5, 6], [7, 8]], [[9, 10], [11, 12]]]) b = tf.constant([[3, 4], [1, 2]]) The expected output for me [[1, 0], [0, 0]] Explanation: I need to find indices of all full vector matches (by axis 2 in this case). The problem is that I don’t ..
I am training my models and I have written some Keras custom callbacks, which I wrap in a tf.keras.callbacks.CallbackList and call using the .on_train/epoch/batch_begin/end() functions. These functions take two arguments, epoch/batch and logs, which is a dictionary containing some ad hoc values that you would set, as far as I understand, using the high level ..
belos is my code to ensure that the folder has images, but tf.keras.preprocessing.image_dataset_from_directory returns no images found. What did I do wrong? Thanks. DATASET_PATH = pathlib.Path(‘C:UsersxxxDocumentsimages’) image_count = len(list(DATASET_PATH.glob(‘.*.jpg’))) print(image_count) output = 2715 batch_size = 4 img_height = 32 img_width = 32 train_ds = tf.keras.preprocessing.image_dataset_from_directory( DATASET_PATH.name, validation_split=0.8, subset="training", seed=123, image_size=(img_height, img_width), batch_size=batch_size) output: Found 0 ..
I keep getting this error when running my python 3.8 code: AttributeError: module ‘tensorflow._api.v2.train’ has no attribute ‘SessionRunHook’ I previously read that this is because the tensorflow version is not correct. How do I use a different version of tensorflow? I have tried: import tensorflow as tf tf.compat.v1.disable_v2_behavior() print(tf.__version__) but it still shows that I ..
I am currently trying to use a Tensorflow dataset as input to the predict() function of a tensorflow model. For some reason, I always get an error, details are below. I have the following generator: def create_dataset(Q, unary_potentials, features_1, features_2, features_3, kernel_size, depth_image): height, width, _ = np.shape(unary_potentials) Q = np.pad(Q, [[kernel_size, kernel_size], [kernel_size, kernel_size], ..
In tf 2.5, there are two functions for cropping an image: tf.image.stateless_random_crop, and tf.image.random_crop. The documentation states that stateless_random_crop is deterministic (always returns the same crop given one seed). However, random_crop has a seed parameter and is also deterministic, one would think. What is the actual difference between these two functions? I cannot find information ..
I have 195 images in jpg format and I want to convert them to tfrecords. I use 5 shards but the size of the shards is zero except for the last one. I used tensorflow object detection API code example. Source: Python..
I used TF 1.4 to train some object detection models in the past, and I remember that the evaluation during the training shows the mAP of the model. My problem is that now, on TF 2.5, these metrics are not shown, and I need this to evaluate my success. This is my only output: I0715 ..