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

‘serving_default’ : Classification input must be a single string Tensor

I’m building a very simple Classifier. The input data has the following features job object marital object education object default int64 housing int64 loan int64 contact object dayofmonth object month object duration int64 campaign int64 pdays int64 previous int64 poutcome object First version of the serving function def serving_input_receiver_fn(): feature_spec = { ‘job’ : tf.placeholder(dtype […]

Categories
Development

JQ getting compile error response from query

I would like to ask for your guidance for newbie like me on testing query on a sample file. I’m getting compile error while testing it. Please advice on what is needed to adjust. JSON FILE –> sample.json { “lambda”: { “apple”: [ { “type”: “fruit”, “color”: “red”, “shape”: “round”, “cron”: “0/10 * * * […]

Categories
Development

Tensorflow: how to save models while using ScipyOptimizerInterface?

I’m using ScipyOptimizerInterface for training a tensorflow model. (tensorflow 1.13.1) During the process of training, if the loss value is below a threshold, I want the training process to stop and save the model right before the threshold was crossed. Below is the script that I tried. The idea is to raise an exception to […]

Categories
Development

tensorflow VGG16 network accuracy and loss doesn’t change

I try to handcraft a VGG16 model with using tensorflow for training with my own dataset, which only have 2 classes, so I find VGG16 network architecture and the way how to train network on github as reference But somehow the code I found doesn’t work, so I try to fixed the code. After I […]