Why input is scaled in tf.nn.dropout in tensorflow?

This scaling enables the same network to be used for training (with keep_prob < 1.0) and evaluation (with keep_prob == 1.0). From the Dropout paper: The idea is to use a single neural net at test time without dropout. The weights of this network are scaled-down versions of the trained weights. If a unit is … Read more

What is the difference between .pt, .pth and .pwf extentions in PyTorch?

There are no differences between the extensions that were listed: .pt, .pth, .pwf. One can use whatever extension (s)he wants. So, if you’re using torch.save() for saving models, then it by default uses python pickle (pickle_module=pickle) to save the objects and some metadata. Thus, you have the liberty to choose the extension you want, as … Read more

what is the difference between Flatten() and GlobalAveragePooling2D() in keras

That both seem to work doesn’t mean they do the same. Flatten will take a tensor of any shape and transform it into a one dimensional tensor (plus the samples dimension) but keeping all values in the tensor. For example a tensor (samples, 10, 20, 1) will be flattened to (samples, 10 * 20 * … Read more

Tensorflow serving No versions of servable found under base path

I had same problem, the reason is because object detection api does not assign version of your model when exporting your detection model. However, tensorflow serving requires you to assign a version number of your detection model, so that you could choose different versions of your models to serve. In your case, you should put … Read more

Running the Tensorflow 2.0 code gives ‘ValueError: tf.function-decorated function tried to create variables on non-first call’. What am I doing wrong?

As you are trying to use function decorator in TF 2.0, please enable run function eagerly by using below line after importing TensorFlow: tf.config.experimental_run_functions_eagerly(True) Since the above is deprecated(no longer experimental?), please use the following instead: tf.config.run_functions_eagerly(True) If you want to know more do refer to this link.

How to understand loss acc val_loss val_acc in Keras model fitting

Answering your questions: As described on official keras FAQ the training loss is the average of the losses over each batch of training data. Because your model is changing over time, the loss over the first batches of an epoch is generally higher than over the last batches. On the other hand, the testing loss … Read more

Can Keras deal with input images with different size?

Yes. Just change your input shape to shape=(n_channels, None, None). Where n_channels is the number of channels in your input image. I’m using Theano backend though, so if you are using tensorflow you might have to change it to (None,None,n_channels) You should use: input_shape=(1, None, None) None in a shape denotes a variable dimension. Note … Read more

What is Adaptive average pooling and How does it work?

In average-pooling or max-pooling, you essentially set the stride and kernel-size by your own, setting them as hyper-parameters. You will have to re-configure them if you happen to change your input size. In Adaptive Pooling on the other hand, we specify the output size instead. And the stride and kernel-size are automatically selected to adapt … Read more