Questions tagged [tensorflow]

TensorFlow is an open source library for machine learning and machine intelligence. TensorFlow uses data flow graphs with tensors flowing along edges. For details, see https://www.tensorflow.org. TensorFlow is released under an Apache 2.0 License.

Filter by
Sorted by
Tagged with
0
votes
0answers
8 views

Keras is adding dimension to shape

When I create an InputLayer, a None dimension gets added. I don't know why this is. ...
1
vote
0answers
9 views

What does it mean to say convolution implementation is based on GEMM (matrix multiply) or it is based on 1x1 kernels?

I have been trying to understand (but miserably failing) how convolutions on images (with height, width, channels) are implemented in software. I've heard people say their convolution implementation ...
2
votes
1answer
16 views

Playing cards object detection problem?

I'm trying to train an object detection model to detect some of playing cards for example it will detect 1,2,3, king, queen and jack and i'm making a class of not and i have put examples of other ...
0
votes
0answers
9 views

ValueError : All input arrays (x) should have the same number of samples in LSTM [closed]

I have the following network where I want to use two different time windows for my lstm network, but got this error. Could you help me to solve that? ...
0
votes
0answers
15 views

How do I implement my loss function in Keras/Tensorflow, when it seems to have different parameters to the default ones?

So, I'm a university student studying Data Science, and after my previous question about TensorFlow got literally zero answers on Stack Overflow, I figured I'd post this one here instead. I need to ...
0
votes
0answers
7 views

Can I set the perposal anchor boxes to a specific size in object detection?

I'm trainig a SSD MobileNet V2 FPNLite 640x640 object detection model on custom dataset, I undorstood that to make the model train faster is to change the parameters of anchor_generator for example, ...
0
votes
1answer
63 views

Custom loss function with both min(y, p) and max(y,p)

I'm creating a neural network in tensorflow and need to minimize the following loss function: $\frac{max(y,p)}{min(y,p)}$ Where $y$ represents the true value and $p$ the predicted value. Since the ...
0
votes
0answers
9 views

Face matching using VGGFace library keras

I am working on face matching model (matching between id-card faces and selfies), where I am using the resnet50 pre-trained model from ...
1
vote
0answers
21 views

How to apply pruning on a BERT model?

I have trained a BERT model using ktrain (tensorflow wrapper) to recognize emotion on text, it works but it suffers from really slow inference. That makes my model not suitable for a production ...
0
votes
1answer
29 views

How to choose between Tensorflow and Pytorch?

Recently I've been working on a pretty vanilla ANN model in Python with sklearn (and its preprocessing pipeline), mostly in jupyterhub notebooks if that matters. I am considering changing the ...
2
votes
0answers
14 views

Object detection model's performance jumping up and down

I am training a model to detect buildings from satellite images in rural Africa. For labels, I use OpenStreetMap geometries. I use the Tensorflow Object Detection API and SSD Inception V2 as a model. ...
0
votes
0answers
12 views

Error using shap with SimpleRNN sequential model [closed]

In the code below, I import a saved sparse numpy matrix, created with python, densify it, add a masking, batchnorm and dense ouptput layer to a many to one SimpleRNN. The keras sequential model ...
2
votes
1answer
50 views

Questions about a multivariate timeseries forecasting model - keras

I have trouble understanding the model I'm trying to create. I have few questions so I'll explain my model first and what I'm trying to do: I have created sequences of data (input and ouput of the ...
0
votes
1answer
28 views

Using pretrained LSTM and Bert Models in CPU Only Environment - How to speed up Predictions?

I have trained two text classification models using GPU on Azure. The models are the following Bert (ktrain) Lstm Word2Vec (tensorflow) Exaples of the code can be found here: nlp I saved the models ...
0
votes
0answers
6 views

Right Package for Federated Learning

Could Someone list the pros and cons with respect to using federated learning with the following packages: TensorFlow federated PySyft Are there certain tasks which are specific to either or is one ...
0
votes
0answers
12 views

Tensorflow Model not returning a Distribution object when having DistributionLambda as last layer in a multitasking model

I am building a TF CNN model that takes a picture as input and has 3 outputs (multitask learning). On one of the output layers, I would like to output a distribution object, ...
0
votes
0answers
13 views

Question about Relative-Position-Representation code

In https://github.com/tensorflow/tensor2tensor/blob/master/tensor2tensor/layers/common_attention.py In _relative_attention_inner method, which I think is one of the ...
-1
votes
0answers
15 views

what's the difference between Bias and Variance in Deep learning [duplicate]

what's the difference between Bias and Variance in deep learning i know just that Bias is the difference between your model's expected predictions and the true values , and Variance refers to your ...
0
votes
1answer
11 views

Different results between ImageDataGenerator and model.predict in Tensorflow

I am training a simple cnn using flow from directory with train and validation datasets. The dataset pattern are as follows, ...
-2
votes
0answers
16 views

How to guarantee the tensorflow model will not crash on a GPU while playing a video game?

Let's say that I have a model that is constantly running inference on the GPU. And I also want to play a heavy video game using the GPU. I set the limit of the model to use 300 MB of GPU memory. What ...
3
votes
1answer
28 views

Keras model to focus on different metrics?

When using the model.compile() attribute, does it matter what metric I place in there? For example, would ...
0
votes
1answer
16 views

What is the use of function build in custom layers in tensorflow keras?

I am trying to build my own custom keras layer following the documentation at https://www.tensorflow.org/api_docs/python/tf/keras/layers/Layer In the custom layers we need three functions call, build ...
0
votes
0answers
23 views

Continue with LSTM or try other approaches?

I am trying to predict error (deviation from the actual behavior) in a signal, here is an example Blue -> Reference/Actual signal (cannot be fed to the network, used to calculate error only) Orange ...
0
votes
0answers
10 views

Validation test unstable

I'm learning some neural network by using tensorflow. I created a dataset of watermarked and not watermarked image, and I'm trying to create a model do classify both. I started from ...
-1
votes
0answers
15 views

What are the parameters that calculate the time to run each epoch of a deep learning model while training it

I am currently working on biomedical image segmentation with deep learning models. The model needs some time to train with the given data in each epoch. I mean the ETA for each epoch while running the ...
1
vote
1answer
23 views

NLP: what are the advantages of using a subword tokenizer as opposed to the standard word tokenizer?

I'm looking at this Tensorflow colab tutorial about language translation with Transformers, https://www.tensorflow.org/tutorials/text/transformer, and they tokenize the words with a subword text ...
0
votes
0answers
5 views

Case weights with sequence to sequence models?

I've got a bunch of variable-length sequences. They're basically vectors of zeros with the occasional one. Event rate is maybe 1%. I want to build a model that will take sequences that I get in the ...
0
votes
1answer
16 views

Combine K-nearest neighbor with categorical embedding

I've tried a few ways to do my multi-class classification. For categorical data, I used the embedding technique with Tensorflow, which moves the entity closer with its similarity. This technique ...
1
vote
0answers
19 views

Is Keras LSTM the right choice?

My Keras LSTM NN improves to a val_loss of around 0.005 when training with 75% of my 4000-s long time series. I've ran the GridSearchCV to tune the hyperparameters ...
0
votes
0answers
7 views

What is the explanation of discretized log logistic in the following code? Is there any reference regarding this piece of code?

I have taken the following piece of code from the OpenAI code of GitHub from the following link: https://github.com/openai/iaf/blob/master/tf_utils/distributions.py#L28 def discretized_logistic(mean, ...
0
votes
0answers
15 views

Training tensorflow Resnet on Pets2009 data with multiple bounded boxes [closed]

I am facing a very trivial problem which might be totally based on my lack of knowledge but I am fed up trying multiple ways and failing. I am using Pets2009 dataset. Images are loaded in dataset. ...
0
votes
0answers
22 views

LSTM model performs worse after retrains

I'm using a bidirectional, stateless LSTM (Keras/Tensorflow) for time series prediction.The procedure is as follows: We have a singal: $[0, 1, 2, 3, 4, \ldots, n]$ We scale values: $x_i ^ {scaled} = ...
0
votes
0answers
7 views

Tensorflow tokeniser: the maximum number of words to keep

Trying to tokenize the IMDB movie reviews by applying Tensorflow tokenizer. I want to have a maximum 10000-word vocabulary. For unseen words, I use a default token. ...
0
votes
0answers
8 views

Training with data from multiple tfrecords files simultaneously

I am training a neural network in TensorFlow using several distinct groups of data, lets call them Data A, Data B and Data C. I want to have them mixed during training, ie, I do not want to train on A,...
0
votes
0answers
9 views

Intuition behind CNN Training Accuracy being Different than Loaded Model predicted on same exact data

I am trying to display some metrics in my final evaluation of several CNN models that I have trained using Tensorflow/Keras. I want to list the training accuracy for demonstration sake. However, I am ...
0
votes
0answers
23 views

Regression ANN getting high root mean squared error values after re scaling dataset

I have a data set on predicting solar power generation, I am getting root mean squared loos of 0.3196 on training set on scaled values, but when I inverse transform them my loss rises to 298 on ...
0
votes
1answer
36 views

ANN regression accuracy and loss stuck

I have a data set on predicting solar power generation,the dataset has 20 independent var and 1 dependent. The accuracy of my model is stuck at 60%. I have tried several models but this accuracy is ...
0
votes
0answers
17 views

Tensorflow: convert PrefetchDataset to BatchDataset

Tensorflow: convert PrefetchDataset to BatchDataset With latest Tensorflow version 2.3.1I am trying to follow basic text classification example at: https://www.tensorflow.org/tutorials/keras/...
0
votes
1answer
28 views

How to Save Model that has a TensorFlow Probability Regularizer?

Consider the following minimal VAE: ...
1
vote
0answers
22 views

Transfer learning with many small datasets

Context I am working on a NLP-model that can classify documents into one of N categories. I have document data from a number of different customers. The document topics are similar across customers ...
0
votes
1answer
33 views

Creating a image classification model [closed]

I am working on a dataset to classify facial expressions. Dataset has 7 classes, training images 28000 and test images 7000. I created 2 models Model1: this model has 11 layers. Initially model was ...
0
votes
1answer
14 views

How to train the model with for loop instead of the built-in epochs

i want to use a for loop for epochs instead of the built-in ones. Does these parts are similar. 1) ...
0
votes
0answers
16 views

How to structure and train an LSTM for real-time predictions in Keras?

I am trying to create an AI to play a 3D melee fighting game using an LSTM. The NN receives as input the relative positions of the enemies' joints (e.g. head, hands, legs) and should output the ...
0
votes
0answers
82 views

Load numpy data from directory to keras image generator

I have two folders of hyperspectral data with five channels which are converted to numpy array. Each folder depicts the respective label. Example : ...
1
vote
0answers
8 views

How does Keras.Model() retrieve the different layers between its passed input and output layers?

I have recently been learning Keras and am trying to understand how the keras.Model function is able to interpolate the different layers between passed input and output layers. Do the input or output ...
0
votes
0answers
7 views

Keras error on concatenating a list of tensors

I'm reproducing two versions of what I believe to be the same code, but one of them works, the other doesn't: ...
0
votes
0answers
266 views

Python: ValueError: Unknown layer: Functional

model_path = './models/VGG16_res.h5' model = load_model(model_path) This is the code which I'm using to load a model TensorFlow version: 2.3.0 I'm not sure ...
0
votes
2answers
30 views

Why we need to have the test set remains consistent across multiple runs?

In the book "hands-on machine learning with scikit-learn and tensorflow: concepts, tools, and techniques to build intelligent systems" , more specifically in chapter 2 , the writer is ...
0
votes
0answers
25 views

Varitional Autoencoder not accepting batch size or validation data

The input to the VAE will be a customer vector where the index of the vector represents a product id, position i in vector x is set to one iff product id i has been purchased by the customer. For ...

1
2 3 4 5
32