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
Development

Runtime error when reading data from a training dataset PyTorch

I have a sample of data in my training dataset which I am able to view if I print the data, but when accessing it to train the data, I keep getting RuntimeError: Expected object of scalar type Double but got scalar type Float for argument #2 ‘weight’ in call to _thnn_conv2d_forward. I am unable […]