I can’t find the proper way to add dependencies to my Azure Container Instance for ML Inference. I basically started by following this tutorial : Train and deploy an image classification model with an example Jupyter Notebook It works fine. Now I want to deploy my trained TensorFlow model for inference. I tried many ways, but I was never able
Tag: tensorflow
Tensorflow: Incompatible shapes: [1,2] vs. [1,4,4,2048]
I have the following tensorflow model: I have simplified this somewhat in an attempt to narrow down the problem, When I run this I get the following error: This error always seems to occur on a different input image. All my images are exactly the same dimennsions. I am using tensorflow 2.4.1 What am I missing? Answer The ResNet50 model
Incompatibility between input and final Dense Layer (Value Error)
I’m following this tutorial from Nabeel Ahmed to create your own emotion detector using Keras (I’m a noob) and I’ve found a strange behaviour that I’d like to understand. The input data is a bunch of 48×48 images, each one with an integer value between 0 and 6 (each number stands for an emotion label), which represents the emotion present
How to make a Confusion Matrix with Keras?
I have trained my model (multiclass classification) of CNN using keras and now I want to evaluate the model on my test set of images. Is there a way to create confusion matrix? Answer Thanks for answers. I did like this:
Unable to convert tensorflow.python.framework.ops.Tensor object to numpy array for passoing it in sklearn.metrics.cohen_kappa_score function
I thought of implementing kappaScore metrics using sklearn.metrics.cohen_kappa_score Error I get when I try to run this code: Here the type of y_true and y_pred requires to be in list or numpy array But the type of y_true and y_pred are, When directly try to print it (i.e, without type() function), it shows like this: Unable to use y_true.numpy() (Convert
Tensorflow MirroredStrategy halves the 2nd dimension, though shape in the object remains right
I’ve recently tried to use MirroredStrategy for training. The relevant code is: dataset print is: which is in the correct dimension, but I get the following error: which is odd, as the documentation says that the strategy will halve the first dimension not the second, it should split the dataset for 2, along the first axis. Does anyone know what
Fitting LSTM model
I am trying to fit LSTM model, but it gave me an error with the shape. my dataset has 218 rows and 16 features including the targeted one. I split the data, %80 for training and %20 for testing, after compiling the model and run it, i got this error: Variable definitions: batch_size = 160 epochs = 20 timesteps =
How to use tf.repeat() to replicate a specific column/row/slice?
this thread explains well the use of tf.repeat() as a tensorflow alternative to np.repeat(). one functionality which I was unable to figure out, in np.repeat(), a specific column/row/slice can be replicated by supplying the index. e.g. is there any tensorflow alternative to this functionality of np.repeat()? Answer You could use the repeats parameter of tf.repeat: where you get the first
trying to callibrate keras model
I’m trying to calibrate my CNN model by Sklearn implementation CalibratedClassifierCV, tried to wrap it as KerasClassifier and to override the predict function but without success. someone could say me what I did wrong? this is the model code: this is me trying to calibrate it : the output : valX_cnn and val_y_cnn are of type np.array. tried even to
Extract data from tensorflow dataset (e.g. to numpy)
I’m loading images via I want to use the obtained data in non-tensorflow routines too. Therefore, I want to extract the data e.g. to numpy arrays. How can I achieve this? I can’t use tfds Answer I would suggest unbatching your dataset and using tf.data.Dataset.map: Or as suggested in the comments, you could also try just working with the batches