When I run my code: I get: run(bool_tensor) : [False True False] ValueError: Shape must be rank 0 but is rank 1 for ‘cond/Switch’ (op: ‘Switch’) with input shapes: [3], [3]. But I want the second print to show a Tensor that evaluates to: [-999 999 -999] I have looked into other posts but could find a solution. Thank you

# Tag: tensorflow

## Input 0 is incompatible with layer model_2

i have a generator rev_generator that yields a tuple of two elements (numpyarray of shape (1279,300,1) , int value: 0 or 1) then i pass it to: and then a simple model but when i call fit it throws me an error: Answer If you are using the tf.data.Dataset API, you should set the batch size explicitly and not in

## Create a ML model with tensorflow that predicts a values at any given time range at hourly intervals

I am pretty new to ML and completely new to creating my own models. I have went through tensorflows time-series forecasting tutorial and other LSTM time series examples on how to predict with multi-variate inputs. After trying multiple examples I think I realized that this is not what I want to achieve. My problem involves a dataset that is in

## Keras and Tensorflow OS resource requirement

I keep getting F tensorflow/core/platform/default/env.cc:73] Check failed: ret == 0 (11 vs. 0)Thread tf_data_private_threadpool creation via pthread_create() failed. errors during training, although the machine is quite powerful: altogether 64 logical cores ulimit -s gives 32768, ulimit -u gives 1030608 I want to train the following network with a bunch of online generated 512*512 grayscale images along with two additional parameters

## Keras, simple neural network Error Code (model.predict)

Do any of you know why I get the following error code? My Code : You can ignore the Integrator Part, I just want to know why the model.predict wont work. Here is the error: Answer The problem is with the lines: Here your model is setup to receive a rank 2 tensor as input, but you are only giving

## Adam Optimizer Not Working on cost function

I wanted to make own neural network for MNIST data set and for that using tensorflow i am writing the code imported library and dataset then done one hot encoding and after all done the weights and baises assignment and then done the forward propagation with the random values and for back propagation and cost minimization used a loss function

## Prediction with keras embedding leads to indices not in list

I have a model that I trained with For the embedding I use Glove as a pre-trained embedding dictionary. Where I first build the tokenizer and text sequence with: t = Tokenizer() t.fit_on_texts(all_text) and then I’m calculating the embedding matrix with: now I’m using a new dataset for the prediction. This leads to an error: Node: ‘model/synopsis_embedd/embedding_lookup’ indices[38666,63] = 136482

## How can I print the training and validation graphs, and training and validation loss graphs?

I need to plot the training and validation graphs, and trarining and validation loss for my model. Answer history object contains both accuracy and loss for both the training as well as the validation set. We can use matplotlib to plot from that. In these plots x-axis is no_of_epochs and the y-axis is accuracy and loss value. Below is one

## ImportError: dlopen(…): Library not loaded: @rpath/_pywrap_tensorflow_internal.so

I am a beginner at machine learning. I try to use LSTM algorism but when I write from keras.models import Sequential it shows error as below: How can I fix this? Thank you so much! full error message: Answer Problem solved. install tensorflow again with and change the import to

## How to create a tensor from another tensor like tf.constant and number?

I want to use the value in a tensor to create another tensor, but I got the following error: How can I use the value in tensor a? Answer You can use tf.stack. Check function: