I’m trying to display images of a dataset on a plot with their predictions. But I have this error: cannot compute Pack as input #1(zero-based) was expected to be a float tensor but is a int32 tensor [Op:Pack] name: packed This is the code in which I plot: I have the error on second line, on the tf.squeeze function. I
Tag: machine-learning
Cannot run docker container. Error response from daemon pull
To use TensorFlow serving, I had to use docker. I downloaded the TensorFlow image using After that, I had to start tf serving and map my directories. As a result I have an error :- Answer The volume path contained spaces, putting “” around the path could solve the error In this case, I changed the name of the directory.
Problem with data cast on the GPU in PyTorch
Im trying to do an image classifier, but im having a problem with the data cast on the GPU. Model already is in cuda, but i get error that says Whats the problem with input.to(args[‘device’])? Answer UPDATE: According to the OP, an aditional data.to(device) before the train loop caused this issue. you are probably getting a string like 0 or
How to add histogram from dataframe in tkinter
I am new to Tkinter and am working on a GUI based on ML. I want to add a histogram plot from a dataframe into Tkinter and am stuck. This is the histogram plot: This is part of my code Pls suggest the correction. Answer You can save the histogram to an image and then open it and display it
How to find contours in dotted text captcha image
I am newbie to OpenCV. I’m trying to find the contours of the captcha image. It does not work only when my captcha image contains the dotted text. I have done following code for that: Can anyone help in this? Is there any way to find contours in this image? Answer Here is my code and output
How to put importance coefficients to features before kmeans?
Lets say I have the given dataframe And I would like to find clusters in these rows. To do so, I want to use Kmeans. However, I would like to find clusters by giving more importance to [feature_1, feature_2] than to the other features in the dataframe. Lets say an importance coefficient of 0.5 for [feature_1, feature_2] , and 0.5
model plots – confusion matrix – Accuracy plot
In my code I’m plotting the accuracy curve plot and the confusion matrix heat map. However: 1- I’m getting both plots on one (picture below) 2- Why is the number apering this way ? In my heat map, I need the numbers and the percentages. The code Answer After this row: add a new row:
Remove outlier using quantile python
I need to remove outlier for a regression dataset. Lets say the dataset is consist in the following way With closer inspection, the column humidity has three outliers which are 50.0,18.0,0.01 but for windspeed column the outliers are 20 and 0.05 and both columns outliers are not in the same row. In this case if I remove my outlier with
Add features to the “numeric” dataset whose categorical value must be mapped using a conversion formula
I have this dataset: This is the request: “Add the Mjob and Fjob attributes to the “numeric” dataset whose categorical value must be mapped using a conversion formula of your choice.” Does anyone knows how to do it? For example: if ‘at_home’ value become ‘1’ in Mjob, I want the same result in the Fjob column. Same categorical values must
Missing categorical data should be encoded with an all-zero one-hot vector
I am working on a machine learning project with very sparsely labeled data. There are several categorical features, resulting in roughly one hundred different classes between the features. For example: After I put these through scikit’s OneHotEncoder I am expecting the missing data to be encoded as 00, since the docs state that handle_unknown=’ignore’ causes the encoder to return an