Categories
Mastering Development

Tensorflow with batch size and wrong dimesion

Here are my code: # Model parameters: W and b # tf.reset_default_graph() W = tf.get_variable("weight",shape = [784, 10], dtype=tf.float32) b = tf.get_variable("b", shape=(784,10), dtype= tf.float32) input_X = tf.placeholder(‘float32’, shape = (None,10)) input_y = tf.placeholder(‘float32’, [784, 10]) ogits = W*input_X + b probas = tf.nn.softmax(logits) classes = tf.argmax(probas) loss = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(labels = input_y, logits = logits)) […]

Categories
Mastering Development

Nondeterministic behavior and output behavior In Tensorflow

I am having an issue with thus piece of code I wrote to perform a custom operation in Tensorflow ( 2.3 ) . The code generally works fine but sometimes throws unexpected errors and exceptions even through it worked fine in other executions with the same inputs. I have tried to troubleshoot the issue and […]

Categories
Mastering Development

How to show the prediction values while the neural-network training is on going

I am training a model to classify the video clips out of the two labels, while the model loss keep the same, so I am wondering the prediction values when traning is going on, I do some trying, then comes the error: Cannot assign a device for operation ‘replica_1_5/model_12/activation_7/Softmax’: Could not satisfy explicit device specification […]

Categories
Mastering Development

How to allow keras model predict function in multiple thread algorithm?

I’m trying to train a reinforcement learning(RL) agent on a custom environment. My RL agent is the stable baseline implementation of the DDPG algorithm. It uses multiple threads for training. One of the arguments for this agent is an environment, which is implemented according to Open AI gym custom environment interface. My environment needs to […]

Categories
Development

Cannot feed value of shape (100,) for Tensor ‘Placeholder_1:0’, which has shape ‘(?, 1)’

Tensorflow 1.14 gives me issue “Cannot feed value of shape (100,) for Tensor ‘Placeholder_1:0’, which has shape ‘(?, 1)’” as mentioned in the question. This error occurs in the session segment of the code [last cell of the code]. How do I solve it? Im not able to understand where the bug is lying. The […]

Categories
Development

Why do I get ‘Connecting to invalid output of source node’ error with a Tensorflow-Hub KerasLayer?

Edit: I tried turning on eager execution to see if I could identify exactly where the issue was occuring, and eager execution stopped the errors and made it run successfully. No idea why that would be the case and unfortunately that really doesn’t help me. Original Post: I’m pretty new to Tensorflow and I’m trying […]