tensorflow

ValueError: Arguments `target` and `output` must have the same shape. Received: target.shape=(None, 512), output.shape=(None, 3)

ValueError: Arguments `target` and `output` must have the same shape. Received: target.shape=(None, 512), output.shape=(None, 3) Question: I was trying to train a BERT model to solve a multi-classification problem. I got this error while run the code below: Arguments `target` and `output` must have the same shape. Received: target.shape=(None, 512), output.shape=(None, 3) import tensorflow as …

Total answers: 1

How to check out tensorflow 2.15.0.post1

How to check out tensorflow 2.15.0.post1 Question: The tensorflow tags only has "v2.15.0 –> Nov 15, 2023", but pypi has "tensorflow == 2.15.0.post1" https://pypi.org/project/tensorflow/ tensorflow == 2.15.0.post1 Released: Dec 6, 2023 https://pypi.org/project/tensorflow/2.15.0/ tensorflow == 2.15.0 Released: Nov 15, 2023 https://github.com/tensorflow/tensorflow/tags v2.15.0 –> Nov 15, 2023 How to check out the source code version of "tensorflow …

Total answers: 1

Can't install Tensorflow on Fedora

Can't install Tensorflow on Fedora Question: I’m using Fedora and I installed tensorflow successfully before but today I tried to use it and it’s not there so used pip -m install tensorflow but I’m getting this error ERROR: Could not find a version that satisfies the requirement tensorflow==2.12.0 (from versions: none) ERROR: No matching distribution …

Total answers: 1

Cannot generate random ints inside TensorFlow2.0 "call" function

Cannot generate random ints inside TensorFlow2.0 "call" function Question: I am trying to implement a custom dropout layer. In this dropout layer I want to generate a random number and turn on/off that output. The idea is simple and I thought the implementation would be too. I have tried using the regular ‘random’ python function, …

Total answers: 1

Keras Reshape Layer Error: Total Size of New Array Must Be Unchanged

Keras Reshape Layer Error: Total Size of New Array Must Be Unchanged Question: This is my model import torch import os import cv2 import numpy as np import tensorflow as tf from tensorflow.keras.preprocessing.image import ImageDataGenerator import mediapipe as mp from sklearn.metrics import multilabel_confusion_matrix, accuracy_score # Define the path to your training and testing data directories …

Total answers: 1

Can you reconstruct a Tensorflow neural network from the weights file (.h5) only?

Can you reconstruct a Tensorflow neural network from the weights file (.h5) only? Question: If you want to keep your Neural Network architecture secret and still want to use it in an application, would somebody to be able to reverse engineer the Neural Network from the weights file (.h5) only? The weights are an output …

Total answers: 1

Tensorflow 2.13.1, no matching distribution found for tensorflow-text 2.13.0

Tensorflow 2.13.1, no matching distribution found for tensorflow-text 2.13.0 Question: I am trying to install the latest Tensorflow models 2.13.1 (pip install tf-models-official==2.13.1), with Python 3.11. There seems to be an issue with Cython and PyYAML not playing nice together since last week in Tensorflow models 2.13.0, so it won’t install. But 2.13.1 is giving …

Total answers: 2

Tensorflow model.trainable_variables doesn't update after setting layer.trainable

Tensorflow model.trainable_variables doesn't update after setting layer.trainable Question: Context I’m creating a script which randomly modifies some parameters in a Tensorflow model. It aims to "encrypt" the model by recording the modifications made so that the modifications can be undone by authorised users only. To enable this script, I want to freeze all model layers …

Total answers: 1

I am trying to build a variational autoencoder. I am getting an error while running model.fit which I don't understand

I am trying to build a variational autoencoder. I am getting an error while running model.fit which I don't understand Question: Epoch 1/10 ————————————————————————— TypeError Traceback (most recent call last) <ipython-input-28-f82b6d9aa841> in <cell line: 2>() 1 # Train model —-> 2 model.fit(X_train, y_train, epochs=10, batch_size=16, validation_data=(X_val, y_val)) 1 frames /usr/local/lib/python3.9/dist-packages/keras/engine/training.py in tf__train_function(iterator) 13 try: 14 …

Total answers: 1

Losing all training gains when switching to another PC

Losing all training gains when switching to another PC Question: I am losing all of my training gains when moving to another PC and I can’t figure out why, it should be saving the model after each chunk and it does so because when I restart it on the same PC, the loss is the …

Total answers: 1