GUI and Desktop Applications
int64
0
1
A_Id
int64
5.3k
72.5M
Networking and APIs
int64
0
1
Python Basics and Environment
int64
0
1
Other
int64
0
1
Database and SQL
int64
0
1
Available Count
int64
1
13
is_accepted
bool
2 classes
Q_Score
int64
0
1.72k
CreationDate
stringlengths
23
23
Users Score
int64
-11
327
AnswerCount
int64
1
31
System Administration and DevOps
int64
0
1
Title
stringlengths
15
149
Q_Id
int64
5.14k
60M
Score
float64
-1
1.2
Tags
stringlengths
6
90
Answer
stringlengths
18
5.54k
Question
stringlengths
49
9.42k
Web Development
int64
0
1
Data Science and Machine Learning
int64
1
1
ViewCount
int64
7
3.27M
0
51,685,128
0
0
0
0
1
false
0
2018-08-03T14:33:00.000
0
1
0
Opencv step for Triangulate point from stereo image
51,674,917
0
python,image,opencv,point,triangulation
To triangulate you need to now position of cameras. Those position can be presented in different forms, translate, rotation, or affine, depend of needs. Construct two rays from each camera thru the same landmark. In theory find intersection of those two rays. In practice find point that is closest to both rays. That po...
I'm trying to triangulate points from stereo images.On the web I find a lot of confusion, because there are many different methods. I have two images of the same subject in different angles, with manually defined landmarks,(for example , 2 faces where I scored 3 points: nose and pupils). I would like to go back to the ...
0
1
510
0
51,680,611
0
0
0
0
1
true
2
2018-08-03T19:53:00.000
2
1
0
Is Dataset Organization for Image Classification Necessary?
51,679,311
1.2
python,tensorflow,machine-learning,keras,classification
In your example, you have all the images in memory. You can simply call model.fit(trainX, trainY) to train your model. No need to organize the images in specific folder structures. What you are referring to, is the flow_from_directory() method of the ImageDataGenerator. This is an object that will yield images from the...
I'm currently working on a program that can do binary image classification with machine learning. I have a list of labels and a list of images that i'm using as inputs which are then fed into the Inception V3 model. Will inputting of the dataset this way work with the inception V3 architecture? Is it necessary to orga...
0
1
145
0
51,758,333
0
0
0
0
1
true
0
2018-08-04T09:24:00.000
0
1
0
google.protobuf.text_format.ParseError: 9:18 : Couldn't parse integer: 03
51,684,220
1.2
python-3.x,ubuntu,tensorflow,video-processing,object-detection-api
I faced a similar problem relating to label_map_path when running on local machine. Solved by removing spaces between lines in the label map pbtxt file. Please check config file as well.
Im using python 3.6 tensorflow 1.5 im following the link But got the error: doe@doe:~/anaconda3/envs/tensorflow/models/research/object_detection$ python3 train.py --logtostderr --train_dir=training/ --pipeline_config_path=training/ssd_mobilenet_v1_coco.config WARNING:tensorflow:From /home/doe/anaconda3/lib/python3.6/si...
0
1
1,370
0
51,694,410
0
0
0
0
1
false
0
2018-08-05T11:54:00.000
1
1
0
ImportError: cannot import name __check_build
51,694,076
0.197375
python,scikit-learn,sklearn-pandas
I've been able to install scikit-learn on a fresh virtualenv here but it seems you need to do some extra job to get it up-and-running: By doing just pip install scikit-learn and then from sklearn import svm you'll get import errors, it seems the library requires numpy and scipy. So you need to do: pip install numpy sc...
from sklearn import svm ImportError: cannot import name __check_build
0
1
4,987
0
51,696,373
0
0
0
0
1
false
0
2018-08-05T14:03:00.000
0
1
0
Determine all colors in bounding box in OpenCV/Python
51,695,023
0
python,opencv,colors
It can be done by using a grayscale convertion of your image or of your ROI. You can weather process the histogram of the ROI extract from the gray scale (or convert to grayscale if extracted from the colour image) and count the non zero value. Or you can copy all the gray-scale value of your ROI into a set container,...
Given a bounding box for an image in OpenCV, is there a way to return all the colors inside the box? Ideally, the output would give the information along the lines of "In the bounding box, it is 50% white, 25% blue, 15% green, 10% red." Is there any way to do this? At the very least, is there some function that could ...
0
1
672
0
51,729,004
0
0
0
0
1
false
0
2018-08-06T11:25:00.000
0
1
0
Height of a random forest decison tree increasing till 25 and the test accuracy also increases
51,706,535
0
python,random-forest,cross-validation,xgboost,test-data
This is extremely dependent on the dataset at hand. For such a small dataset tree depth of 25 is indeed on the high side and I would say somewhat unusual. But it is not impossible. What it can depend on: relation between features and the target categorical vs numerical features imbalance of 0 vs 1 target your code imp...
I have a dataset of [~16k] and am doing binary classsfication [0/1].When i am doing hyperparameter grid search in random forest my train and test accuracy increase as increase the depth[optimum is coming out to be 25].I am getting a test accuracy of as high as 97% and no there is no data leakage as there are three sets...
0
1
102
0
51,730,840
0
0
0
0
1
true
0
2018-08-07T15:22:00.000
0
1
0
Bokeh Dynamically Update xrange based on a ColumnDataSource
51,730,321
1.2
python,bokeh
No, FactorRange objects are only configurable by setting the factors property of the range. It is not possible to link the factors property to a CDS directly. (Factor ranges support multi-level hierarchical levels, and that does not map naturally to CDS columns.) However, you can change the value of factors to whatever...
Is there a way to update the xaxis of a bar chart using a columndatasource object? I have a chart that updates the bars based off of what is selected, but I want the tick marks in the xaxis to only represent the values that are being displayed. So, I figured the best option would be to dynamically update the xrange as ...
0
1
1,385
0
51,743,453
0
0
0
0
1
false
3
2018-08-07T15:33:00.000
1
2
0
How to compare two 3D curves in Python?
51,730,532
0.099668
python,computational-geometry,curve-fitting
If you subsample the original curve, a simple way to assess the approximation error is by computing the maximum distance between the original curve and the line segments between the resampled vertices. The maximum distance occurs at the original vertices and it suffices to evaluate at these points only. By the way, thi...
I have a huge array with coordinates describing a 3D curves, ~20000 points. I am trying to use less points, by ignoring some, say take 1 every 2 points. When I do this and I plot the reduced number of points the shape looks the same. However I would like to compare the two curves properly, similar to the chi squared te...
0
1
1,324
0
52,075,500
0
0
0
0
1
false
0
2018-08-08T04:19:00.000
1
2
0
How to add custom colors to Tensorflow object detection python model bound boxes?
51,738,546
0.099668
python,tensorflow,computer-vision,data-science,object-detection
I sort of found a way - after much trouble. I found nothing documenting how to do this. Sort of, as some colors don't seem to work. Open "visualizations_utils.py". Should be in Lib\site-packages\utils. Rows 41 to 63 are your colors. Directly under row 164, draw = ImageDraw.Draw(image), enter a new row color = 'Pin...
Currently i am using the standard Tensorflow object detection script which is custom trained, i would like to change the colors of the bound boxes to suit the nature of my application. However i cannot seem to find a way to do so. For example instead of drawing a green box id like to draw a red box around a detected ob...
0
1
1,764
0
51,748,887
0
1
0
0
1
false
1
2018-08-08T07:59:00.000
0
1
0
Best way to get the values from dict or list for 3 different dataframes
51,741,482
0
python-3.x,pandas,plotly,plotly-dash
it was easy as [v.columns for k, v in all_options.items()] Thank you :)
So, I have 3 different data frames: all_options = {'free': free, 'paid': paid, 'all': df} What is the best way to iterate over to get the values for each one? I want to make a plot in dash. So when user will click on "free" data frame it will show him the graph with free items only?
0
1
32
0
51,745,774
0
0
0
0
1
false
0
2018-08-08T11:32:00.000
0
3
0
Python | count number of False statements in 3 rows
51,745,679
0
python,pandas,countif
Try this : df[df==false].count()
Columns L,M,N of my dataframe are populated with 'true' and 'false' statements(1000 rows). I would like to create a new column 'count_false' that will return the number of times 'false' statement occurred in columns L,M and N. Any tips appreciated! Thank you.
0
1
1,777
0
51,748,484
0
0
0
0
1
false
0
2018-08-08T13:44:00.000
1
1
0
custom constraint of weight matrix
51,748,305
0.197375
python,keras
By far the easiest way to ensure that is to check wether the trained W has determinant 0. If it doesn't then you're OK to go, if it does you can add a small constant (1e-7) to any weight in the matrix and solve the issue. I can tell you anyway that the odds of zero determinant happenning are almost negligible.
I want to invert a classifier on MNIST dataset on keras, thus the determinant of weight matrix must not be zero. Then I can use x=W-1f-1(y) But there is no custom constraint in keras.
0
1
61
0
51,754,972
0
0
0
0
2
false
39
2018-08-08T13:54:00.000
2
7
0
Does ImageDataGenerator add more images to my dataset?
51,748,514
0.057081
python,tensorflow,machine-learning,keras,computer-vision
Also note that: These augmented images are not stored in the memory, they are generated on the fly while training and lost after training. You can't read again those augmented images. Not storing those images is a good idea because we'd run out of memory very soon storing huge no of images
I'm trying to do image classification with the Inception V3 model. Does ImageDataGenerator from Keras create new images which are added onto my dataset? If I have 1000 images, will using this function double it to 2000 images which are used for training? Is there a way to know how many images were created and now fed i...
0
1
20,435
0
68,196,196
0
0
0
0
2
false
39
2018-08-08T13:54:00.000
0
7
0
Does ImageDataGenerator add more images to my dataset?
51,748,514
0
python,tensorflow,machine-learning,keras,computer-vision
Let me try and tell u in the easiest way possible with the help of an example. For example: you have a set of 500 images you applied the ImageDataGenerator to the dataset with batch_size = 25 now you run your model for lets say 5 epochs with steps_per_epoch=total_samples/batch_size so , steps_per_epoch will be equal t...
I'm trying to do image classification with the Inception V3 model. Does ImageDataGenerator from Keras create new images which are added onto my dataset? If I have 1000 images, will using this function double it to 2000 images which are used for training? Is there a way to know how many images were created and now fed i...
0
1
20,435
0
51,751,064
0
0
0
0
1
false
3
2018-08-08T15:50:00.000
0
1
0
CSV file unable to upload
51,750,841
0
python-3.x,jupyter-notebook,linear-regression
try to use the full qualified path, or in the same directory of the main programm
Trying to load CSV file while doing simple linear regression . When I try to run , the error is coming as - "File name" is not exist as file/directory . Do I need to save the file in a particular folder or directory ?
0
1
220
0
51,757,163
0
0
0
0
2
false
3
2018-08-08T22:31:00.000
1
2
0
Is training accuracy of a model calculated on the mini-batch?
51,756,558
0.099668
python,tensorflow,machine-learning
Ideally training accuracy should be calculated including every sample, but practically, it's all right to use a subset of the data as long as its representative of all data. Whether a random batch of 100 samples is representative of your data or not, depends on the problem at hand. For instance if you were classifyin...
I'm trying to record the training accuracy of the model at the end of each epoch, but I wasn't sure if the training accuracy is calculated on the entire training data or the last mini-batch used for training. For example, if I have 10000 training data and I'm training with mini-batches of 100, would I calculate the tra...
0
1
1,493
0
51,757,886
0
0
0
0
2
false
3
2018-08-08T22:31:00.000
1
2
0
Is training accuracy of a model calculated on the mini-batch?
51,756,558
0.099668
python,tensorflow,machine-learning
I agree with @Cory that ideally training accuracy should be calculated on every training sample. Instead of using an running average (exponential, perhaps), I keep the sum of last, let's say, 50 mini-batches. Then I report the average loss across these mini-batches. You can easily track the model's recent performance (...
I'm trying to record the training accuracy of the model at the end of each epoch, but I wasn't sure if the training accuracy is calculated on the entire training data or the last mini-batch used for training. For example, if I have 10000 training data and I'm training with mini-batches of 100, would I calculate the tra...
0
1
1,493
0
51,760,289
0
0
0
0
1
false
0
2018-08-09T00:35:00.000
1
1
0
How to run same Keras model on different GPUs in parallel independently with different data?
51,757,355
0.197375
python,tensorflow,parallel-processing,keras
How about multiprocessing? You just execute you function in a multiprocessing pool twice: What you need to consider: Your model have to be defined or loaded inside the function You need a parameter which mask the GPUs. Masking is possible by setting the env variable CUDA_VISIBLE_DEVICES(you also have to do this inside...
Let's say I have two instances of a keras model model0 and model1 and datasets data0 and data1. If I have two or more GPUs, is there a way that I can train model0 on data0 on GPU0 and model1 on data1 on GPU1 in parallel? All of the methods I have found so far split the training of a single model over multiple gpus. Tha...
0
1
196
0
54,832,068
0
0
0
0
1
false
0
2018-08-09T04:57:00.000
3
3
0
difference between `header = None` and `header = 0` in pandas
51,759,122
0.197375
python-3.x,pandas,csv,dataframe
The difference pops up when working with a dataframe with header, so lets say your DataFrame df has header! header=None pandas automatically assign the first row of df (which is the actual column names) to the first row, hence your columns no longer have names header=0, pandas first deletes column names(header) and th...
I was writing a code to read a csv file using pandas and I saw some weird functioning of the package. My file has column names which I want to ignore, so I use header = 0 or 'infer' instead of None. But I see something weird. When I use None and I want to get a specific column, I just need to do df[column_index] but wh...
0
1
23,961
0
52,239,819
0
0
0
0
1
true
2
2018-08-09T05:45:00.000
4
1
0
What is the closest function to R's nlminb in Python?
51,759,606
1.2
r,python-3.x,scipy,nonlinear-optimization
nlminb is an unconstrained and bounds-constrained quasi-Newton method optimizer. This code is based on a FORTRAN PORT library by David Gay in the Bell Labs. As for Pyhon quasi-Newton menthods are: Unconstrained minimization Method BFGS uses the quasi-Newton method of Broyden, Fletcher, Goldfarb, > > and Shanno (BFGS) ...
Python scipy.optimize.minimize function supports the following methods: Nelder-Mead Powell CG BFGS Newton-CG L-BFGS-B TNC COBYLA SLSQP trust-constr dogleg trust-ncg trust-exact trust-krylov Which method is closest to R's nlminb?
0
1
761
0
51,861,681
0
0
0
0
1
false
0
2018-08-09T06:07:00.000
0
1
0
Pytorch Convolutional Layer returning Nan
51,759,882
0
python,neural-network,artificial-intelligence,conv-neural-network,pytorch
Try to initialize your weights with random numbers between 0 and 1 and then try different learning rates for your network training. (I suggest test it with learning rates equal to 10, 1, 0.1, 0.01, ...)
so I am using a convolutional layer as the first layer of a neural network for deep reinforcement learning to get the spatial features out of a simulation I built. The simulation gives different maps that are of different lengths and heights to process. If I understand convolutional networks, this should not matter sin...
0
1
1,443
0
51,777,618
0
0
0
0
1
false
0
2018-08-09T07:22:00.000
0
1
0
How to build a predictive model where there will be unseen categorical variables in the future
51,761,031
0
python,machine-learning,scikit-learn
I don't think that's possible. However, you can do the following: Assume that for each race there are 10 horses. Number them from 0 to 9. Include all the features you want for all the horses, and predict which horse number will win. For example: horse 0: horse_age0, horse_weight0, race_distance0, jockey0 horse 1: ho...
Suppose I have built a model to predict the final positions of horses in horse racing using data of races and horses from the past 10 years with the following features: horse_age, horse_weight, race_distance, jockey Now, I would like to predict positions in horse racing for the upcoming season. However, during those 10...
0
1
126
0
51,762,007
0
0
0
0
1
false
0
2018-08-09T08:05:00.000
1
1
0
After clustering, How do i choose the best customers (subset) from the top cluster?
51,761,810
0.197375
python,cluster-analysis,unsupervised-learning
Try some good old filtering! Select one or several features, create your own metric (maybe top customers are those who buy the most, or those who are more loyal/have stayedlonger with the company, or a weighted sum of those two factors), sort the 660 customers in your cluster and pick only the N first customers, N bein...
I ran a clustering exercise to identify my top customers based on 12 distinct features, using K-Means (on 3 PCA dimensions and 5 PCA dimensions) and GMM (using 5 PCA dimensions) methodologies. Both the outputs from the K-Means produced almost similar customers as the best set (1182 customers in each case with an overla...
0
1
50
0
51,766,044
0
0
0
0
1
false
0
2018-08-09T11:06:00.000
1
3
0
scikit-learn deprecated GMM.eval() replacement
51,765,325
0.066568
python,scikit-learn,gmm
Eval(X) Parameters : X: array_like, shape (n_samples, n_features) : List of n_features-dimensional data points. Each row corresponds to a single data point. Returns : logprob: array_like, shape (n_samples,) : Log probabilities of each data point in X responsibilities: array_like, shape (n_samples, n_components) : Pos...
The eval() method under sklearn.mixture.GMM from the scikit-learn version 0.11 is deprecated. Is there a similar method or a workaround in the newest version 0.19.2 ?
0
1
515
0
51,771,528
0
0
0
0
1
false
1
2018-08-09T15:51:00.000
2
2
0
Pixel correlation / similarity in an image Python
51,771,344
0.197375
python,image,correlation,cross-correlation
Correlation is a measure to evaluate mutual relationship or connection between two or more things, usually vectors, not single point. Pixel is a single point with a single value. So, in your case, I would subtract pixel value form each pixel value of the image, looking at the difference in this case.
I am new in Python. I have an image of size 8*8, and when flattened = 64. Is there any function that measures the correlation between the pixel i and all the other pixels in this image ? So at the end I want to plot a 64*64 matrix of correlation. Thanks !
0
1
1,074
0
51,794,321
0
0
0
0
1
true
1
2018-08-09T19:00:00.000
1
1
0
Regression through reinforcement learning
51,774,091
1.2
python,neural-network,reinforcement-learning
In order to output the correct power and angle, all you need to do is go into your neural network architecture and change the activation of your last layer. In your question, you stated that you are currently using an action classification output, so it is most likely a softmax output layer. We can do two things her...
I'm trying to build an Agent that can play Pocket Tanks using RL. The problem I'm facing now is that how can I train a neural network to output the correct Power and Angle. so instead of actions classification. and I want a regression.
0
1
748
0
51,957,181
0
1
0
0
2
false
0
2018-08-09T21:36:00.000
0
3
0
ImportError: dateutil 2.5.0 is the minimum required version
51,776,103
0
python,pandas,pip,easy-install,python-dateutil
The issue was resolved by installing python 3.6. There is a version compatibility issue between pandas package and earlier version of Python
I'm facing this issue while trying to use pandas package. I have installed numpy 1.9.0 and installed dateutil 2.5.0 using the command pip install python-dateutil==2.5.0. Still I see this error. Is there any other way to install dateutil? And this is related only to pandas package Traceback (most recent call last): ...
0
1
4,264
0
53,266,794
0
1
0
0
2
false
0
2018-08-09T21:36:00.000
1
3
0
ImportError: dateutil 2.5.0 is the minimum required version
51,776,103
0.066568
python,pandas,pip,easy-install,python-dateutil
I had this same issue using the newest pandas version, try downgrading to pandas 0.22.0 which fixed my issue
I'm facing this issue while trying to use pandas package. I have installed numpy 1.9.0 and installed dateutil 2.5.0 using the command pip install python-dateutil==2.5.0. Still I see this error. Is there any other way to install dateutil? And this is related only to pandas package Traceback (most recent call last): ...
0
1
4,264
0
59,889,359
0
0
0
0
1
false
0
2018-08-10T09:07:00.000
0
2
0
how to convert tensorflow .meta .data .index to .ckpt file?
51,782,871
0
python,tensorflow
These { model.ckpt.data-00000-of-00001 model.ckpt.index model.ckpt.meta } are the more recent checkpoint format while {model.ckpt} is a previous checkpoint format It will be in the same concept as to convert a Nintendo Switch to NES ... Or a 3 pieces CD bundle to a single ROM cartridge...
As we know, when using tensorflow to save checkpoint, we have 3 files, for e.g.: model.ckpt.data-00000-of-00001 model.ckpt.index model.ckpt.meta I check on the faster rcnn and found that they have an evaluation.py script which helps evaluate the pre-trained model, but the script only accept .ckpt file (as they provided...
0
1
658
0
62,967,486
0
0
0
0
1
true
0
2018-08-10T10:31:00.000
2
1
0
How can I hand a to bandwidth for the kde to seaborn's distplot?
51,784,529
1.2
python,plot,seaborn,kernel-density
You can use the bandwidth option(bw) with the optional parameter "kde_kws" in the seaborn distplot to set the desired bandwidth. eg : g = g.map(sns.distplot, "value", kde_kws={'bw':0.1})
I am using sns.distplot with hist=True and kde=True. This works fine but for some datasets (e.g. if they contain only discrete values) the kernel density estimation line is zig-zagging which looks very odd given that the histogram underneath is smooth. A manual adjustment of the kde bandwidth should fix this but how ca...
0
1
3,950
0
51,784,896
0
0
0
0
1
false
1
2018-08-10T10:41:00.000
1
2
0
How to classify between a color image and grey scale image using opencv?
51,784,719
0.099668
python,opencv,image-processing,classification,opencv-python
I suspect, some never were grey-scale images after digitizing (e.g. a color scan of gray-scale picture). Due to noise, there are minimal differences in the RGB values. A low threshold greater than perfect zero should do the trick. Please note that JPEG totally has a gray-scale option. However, when storing the picture,...
I have a use case where I need to classify some images as grey scale or color. My initial step was based on the feature that grey scale images should have r,g,b values at a pixel, the same values as it is single channel. Were as for color images, r,g,b values at the same pixel may not be the same. So I am checking by g...
0
1
1,021
0
51,878,303
0
0
0
0
1
false
0
2018-08-12T10:05:00.000
0
1
0
Data extraction from wef output file
51,807,792
0
python,netcdf4
1) Change your Registry files (I think it is Registry.EM_COMMON) so that you print latitude and longitude in your wrfout_d01_time.nc files. 2) Go to your WRFV3 map. 3) Clean, configure and recompile. 4) Run your model again the way you are used to.
I have a wrf output netcdf file.File have variables temp abd prec.Dimensions keys are time, south-north and west-east. So how I select different lat long value in region. The problem is south-north and west-east are not variable. I have to find index value of four lat long value
0
1
26
0
51,826,257
0
1
0
0
1
false
0
2018-08-13T06:27:00.000
0
2
0
Text Input and Numerical Output issue for Exam Schedule Predictor
51,816,305
0
python,machine-learning,deep-learning,regression
Create dummy variables or use RandomForest. They accept text input and numerical output.
I'm working on a model that would predict an exam schedule for a given course and term. My input would be the term and the course name, and the output would be the date. I'm currently done with the data cleaning and preprocessing step, however, I can't wrap my head around a way to make a model whose input is two string...
0
1
21
0
51,833,595
0
0
0
0
1
false
0
2018-08-14T03:34:00.000
0
2
0
Pasting numbers into python so that they may be used as an array
51,833,351
0
python,excel
If I’m reading what you are trying to do correctly, in VS Code, you can do essentially what @sundance suggested by holding Alt and dragging your cursor down the different lines to get a multiline cursor.
Currently I have a large amount of numbers that I am copy and pasting from excel from a column into python and they paste as such: 12 13 14 15 16 ... Each number is on a seperate line. Currently I am having to backspace in front of a number so that it jumps to the previous line then I insert commas between each number ...
0
1
597
0
51,848,259
0
0
0
0
1
true
1
2018-08-14T18:54:00.000
2
1
0
Find the 10 smallest numbers in a large dataset?
51,848,078
1.2
python-3.x,performance,pseudocode
One approach among many possible: Grab 10 values and sort them. Now compare the largest with the 11th through nth values one at a time. Whenever the new value is smaller replace the 10th smallest with it and resort your 10 values. The list of 10 values, sorting them etc will all be in cache so fast even with rough cod...
I am coding specifically in python, but right now in the phase of designing psuedocode for an algorithm that will take all the data points in a data set that has n values, n being very large and pick out the 10 smallest values (or finite number m << n, where m is the m smallest numbers). I wish to have an optimally eff...
0
1
250
0
51,848,498
0
0
0
0
1
false
4
2018-08-14T19:17:00.000
1
4
0
Resize CSV data using Python and Keras
51,848,406
0.049958
python,python-3.x,python-2.7,keras,deep-learning
You could also convert the csv file to a list, truncate the list, and then convert the list to a numpy array and then use np.reshape.
I have CSV files that I need to feed to a Deep-Learning network. Currently my CSV files are of size 360*480, but the network restricts them to be of size 224*224. I am using Python and Keras for the deep-learning part. So how can I resize the matrices? I was thinking that since aspect ratio is 3:4, so if I resize them ...
0
1
1,515
0
57,182,351
0
1
0
0
4
false
178
2018-08-15T04:34:00.000
2
24
0
How do I install opencv using pip?
51,853,018
0.016665
python,opencv
Open terminal Run the following command pip install --trusted-host=pypi.org --trusted-host=files.pythonhosted.org opencv-python. Hope it will work.
I need to install cv2 for a script that has been written for me. I tried pip install cv2 and pip install open_cv and got the same problem - a warning message from dist.py and complains about zlib being not found. No cv2 installed. I also tried pyopenvc and pip install opencv-python. So, I went to the opencv site and d...
0
1
506,854
0
54,848,727
0
1
0
0
4
false
178
2018-08-15T04:34:00.000
3
24
0
How do I install opencv using pip?
51,853,018
0.024995
python,opencv
Open anaconda command prompt and type in below command. conda install -c conda-forge opencv Once the 'Solving environment' is done. It will ask to download dependencies. Type 'y'. It will install all the dependencies and then you are ready to code.
I need to install cv2 for a script that has been written for me. I tried pip install cv2 and pip install open_cv and got the same problem - a warning message from dist.py and complains about zlib being not found. No cv2 installed. I also tried pyopenvc and pip install opencv-python. So, I went to the opencv site and d...
0
1
506,854
0
71,060,884
0
1
0
0
4
false
178
2018-08-15T04:34:00.000
2
24
0
How do I install opencv using pip?
51,853,018
0.016665
python,opencv
->pip install opencv-python you can use this. But if this code does not working then you can check python version on cmd and anaconda because they are different. So you type command in anaconda prompt and cmd, it will work. You can check this -> pip list
I need to install cv2 for a script that has been written for me. I tried pip install cv2 and pip install open_cv and got the same problem - a warning message from dist.py and complains about zlib being not found. No cv2 installed. I also tried pyopenvc and pip install opencv-python. So, I went to the opencv site and d...
0
1
506,854
0
60,336,465
0
1
0
0
4
false
178
2018-08-15T04:34:00.000
0
24
0
How do I install opencv using pip?
51,853,018
0
python,opencv
if you are using Pycharm navigate settings > Project:name > Project interpreter just search the module by name(in this case OpenCV-python) and install it. worked for me
I need to install cv2 for a script that has been written for me. I tried pip install cv2 and pip install open_cv and got the same problem - a warning message from dist.py and complains about zlib being not found. No cv2 installed. I also tried pyopenvc and pip install opencv-python. So, I went to the opencv site and d...
0
1
506,854
0
51,853,382
0
0
0
0
1
false
1
2018-08-15T05:21:00.000
0
2
0
Pandas Dataframe Tail Not Working
51,853,350
0
python,pandas
tail is a method of dataframe. You can do this: print(str(all_ssis_data.tail())) if you want to get page around 6800 you can add 50 as parameter .tail(50) will show the last 50 rows
The size of my pandas dataframe is 6844 and is named all_data_frame. When I type print(str(all_ssis_data.tail)) I get rows in the index range of 0-29 and 3633-3662. Why doesn't it show me rows around the 6800 range?
0
1
1,158
0
51,861,092
0
0
0
0
1
false
1
2018-08-15T14:38:00.000
1
1
0
How does shuffling work while training in tensorflow object detection API
51,860,849
0.197375
python,tensorflow,object-detection-api
The framework does not actually shuffle your data, it's memory intensive and time consuming. Instead, there's an array with random indices that are used to access your data. Usually, indices cover the whole dataset, so, you're right, all data is seen by your network, however in random order.
I have been playing around the tensorflow object detection API for instance segmentation. In the pipeline configuration file, as a part of the train_config we specify the num_steps value. So it is the total number of steps that network is trained on. So let us say, I have 10,000 images in training dataset and batch_si...
0
1
544
0
52,075,651
0
1
0
0
1
true
1
2018-08-15T17:58:00.000
0
1
0
Numpy no module/attribute when importing other packages depending on it
51,864,008
1.2
python,numpy,anaconda,jupyter,miniconda
I had this issue and I think it is related to a broken install. I fixed mine with conda update --all. But I guess you can fix it with uninstalling numpy and reinstalling it back.
On 2 distinct independent systems, I have Anaconda/Miniconda. On my default virtual environment on either one, since 2018-8-15, when I import pandas or matplotlib, I get errors module 'numpy' has no attribute '__version__' and module 'numpy' has no attribute 'square', respectively. An update to conda or one of the modu...
0
1
244
0
51,877,123
0
0
0
1
1
false
0
2018-08-16T03:16:00.000
0
1
0
Why there is binary type after writing to hive table
51,869,125
0
python-2.7,hive
When you read data from oracle to dataframe it's created columns with object datatypes. You can ask pandas dataframe try to infer better datatypes (before saving to Hive) if it can: dataframe.infer_objects()
I read the data from oracle database to panda dataframe, then, there are some columns with type 'object', then I write the dataframe to hive table, these 'object' types are converted to 'binary' type, does any one know how to solve the problem?
0
1
42
0
51,876,979
0
0
0
0
1
true
1
2018-08-16T12:03:00.000
1
1
0
How to decompose affine matrix?
51,876,622
1.2
python-3.x,numpy,transformation,affinetransform,matrix-decomposition
I'm not sure I understand what you're asking. Anyway If you have two sets of 3D points P and Q, you can use Kabsch algorithm to find out a rotation matrix R and a translation vector T such that the sum of square distances between (RP+T) and Q is minimized. You can of course combine R and T into a 4x4 matrix (of rotatio...
I have a series of points in two 3D systems. With them, I use np.linalg.lstsq to calculate the affine transformation matrix (4x4) between both. However, due to my project, I have to "disable" the shear in the transform. Is there a way to decompose the matrix into the base transformations? I have found out how to do so ...
0
1
1,921
0
56,354,392
0
0
0
0
1
false
1
2018-08-16T13:11:00.000
0
1
0
KMeans Clustering on Movielens Dataset
51,877,919
0
python,k-means,data-science,scikit-image
Well, K-Means is a clustering Algorithm so you can use it to cluster the movies based on the genres. Columns: movieId, genres There's a new dataset which includes relevant tags for each movie, so you can also cluster them based on those tags. However, you can also make use of K-Nearest Neighbors to find out how users a...
I am working on the Movielens dataset and I wanted to apply K-Means algorithm on it. I would like to know what columns to choose for this purpose and How can I proceed further Or Should I directly use the KNN algorithm.
0
1
927
0
51,882,505
0
0
0
0
1
true
1
2018-08-16T14:08:00.000
1
3
0
How to get the maximum number of digits after the decimal point in a Pandas series
51,879,063
1.2
python,pandas,dataframe
pd.read_csv() typically returns a DataFrame object. The StringMethods object returned by using .str is only defined for a Series object. Try using pd.read_csv('your_data.csv' , squeeze=True) to have it return a Series object; then you will be able to use .str
I read a list of float values of varying precision from a csv file into a Pandas Series and need the number of digits after the decimal point. So, for 123.4567 I want to get 4. I managed to get the number of digits for randomly generated numbers like this: df = pd.Series(np.random.rand(100)*1000) precision_digits = (d...
0
1
1,611
0
51,881,699
0
0
0
0
1
false
0
2018-08-16T16:24:00.000
2
3
0
Can you download OpenCV with Python 3.5.2?
51,881,545
0.132549
python,opencv,python-3.5
yes, OpenCV 3 works with Python 2.7, 3.4, 3.5, 3.6 and 3.7
Can you download OpenCV with Python 3.5.2? I want to set up OpenCV. But I don't know if I need 2.7 or can I use my already downloaded Python 3.5.2 version. Will it be compatible? I want learn computer vision so I can make some projects. Like a automated waste sorter. But I need to download OpenCV first. Just need some ...
0
1
482
0
51,891,386
0
0
0
0
1
false
0
2018-08-16T23:52:00.000
0
1
0
Keras Callback to Monitor Both Validation and Training Accuracy at the Same Time
51,886,718
0
python,callback,keras
But the model may be overfitted to validation data. Thats basically not possible. If you split your traing data into validation and training correctly, your model does never see the validation data, before it validates the hypothesis, it learned. You can overfit your training data, but you can not overfit your valida...
I recently came to know about Modelcheckpoint Callback in Keras. But it can only monitor Validation Accuracy or Training Acc. It can save best model weights when validation accuracy is maximum. But the model may be overfitted to validation data. Thus, I feel a need to monitor training accuracy as well. I want to save t...
0
1
202
0
51,921,611
0
0
0
0
2
true
2
2018-08-17T03:21:00.000
1
2
0
Loading a saved model in Keras with a custom layer and prediction results are different?
51,887,958
1.2
python,tensorflow,machine-learning,keras,keras-layer
I finally found the answer. I have implemented a custom Lambda layer to handle reshaping. This layer has difficulties loading. Specifically, it reshapes one dimension into two dimensions on an arbitrary interval. The interval was defaulting to one specific value every time I loaded the model, even though it was incorre...
My network was achieving 96% accuracy on my dataset (edit: on predicting 9 classes). I saved the entire model for every epoch (weights included) whenever I ran it. I ran it 3 times, each time testing different hyperparameters, each time achieving around 96% accuracy. When I try to load any of these tests now and run it...
0
1
1,125
0
51,891,264
0
0
0
0
2
false
2
2018-08-17T03:21:00.000
1
2
0
Loading a saved model in Keras with a custom layer and prediction results are different?
51,887,958
0.099668
python,tensorflow,machine-learning,keras,keras-layer
Well, let´s think about it, there are basically two possible reasons for your problem. Your custom layer is not the same and therefore some weights are not set up correctly, which leads to missclassification. In case of a binary classification you will end up in 50% accuracy on balanced data. The second possible reason...
My network was achieving 96% accuracy on my dataset (edit: on predicting 9 classes). I saved the entire model for every epoch (weights included) whenever I ran it. I ran it 3 times, each time testing different hyperparameters, each time achieving around 96% accuracy. When I try to load any of these tests now and run it...
0
1
1,125
0
51,895,476
0
0
0
0
1
true
3
2018-08-17T12:16:00.000
6
1
0
How to know when to use fit_generator() in keras when training data gets too big for fit()?
51,895,278
1.2
python-3.x,machine-learning,keras
The moment you run into memory errors when trying to take the training data into memory, you'll have to switch to fit_generator(). There is extra overhead associated with generating data on the fly (and reading from disk to do so), so training a model on a dataset that lives in memory will always be faster.
When using keras for machine learning, model.fit() is used when training data is small. When training data is too big, model.fit_generator() is recommended instead of model.fit(). How does one know when data size has become too large?
0
1
309
0
51,898,927
0
0
0
0
1
true
0
2018-08-17T15:42:00.000
1
2
0
How to display a pandas Series in Python?
51,898,845
1.2
python,pandas
For the first column, you can use targets_test.keys()[i], for the second one targets_test.values[i] where i is the row starting from 0.
I have a variable target_test (for machine learning) and I'd like to display just one element of target_test. type(target_test) print the following statement on the terminal : class 'pandas.core.series.Series' If I do print(target_test) then I get the entire 2 vectors that are displayed. But I'd like to print just th...
0
1
1,594
0
51,905,252
0
0
0
0
1
false
0
2018-08-18T04:15:00.000
1
1
0
How to implement Region of Interest Pooling layer in tensorflow?
51,905,199
0.197375
python,tensorflow,neural-network,artificial-intelligence
Bilinear sampling - as the name suggests - can actually be used even with end-to-end training as it's basically a linear operation. However, the disadvantage would be that your local maxima (i.e. strong excitations or certain units) could vanish because your sampling points just happen to be close to the minima. To rem...
I am trying to create Faster RCNN like model. I get stuck when it comes to the ROI pooling from the feature map. I know here billinear sampling can be used but, it may not help for end to end training. How to implement this ROI pooling layer in tensorflow?
0
1
506
0
51,926,152
0
0
0
0
1
false
0
2018-08-20T07:38:00.000
0
3
0
When running command "python train.py" to train word-rnn, getting "no module named numpy" error.
51,926,059
0
python,numpy,tensorflow,cmd,anaconda
You can use python's pip installer or anaconda's own installer to install numpy. In pip you use: pip install numpy OR you can use anaconda like below: conda install numpy
OS: Windows 10 Using anaconda3 - 5.2, running commands in Anaconda command prompt. Here's the commands I used to locate the word-rnn and activate the conda enviroment, plus the error messages when I attempt to train the model. I am also going off of a Mac based tutorial, so please correct me if "python train.py" is th...
0
1
701
0
52,290,741
0
0
0
0
1
true
0
2018-08-20T13:13:00.000
0
1
0
Training object detection model too long causes model to crack
51,931,564
1.2
python,object-detection
After some research (and a lot of experiments) I have come to some conclusions which might help others facing the same problem. Failing to detect any object probably means that the model has collapsed in some part of training. A possible indication of this in my case was some extremely high values of loss values when ...
I am using object detection from tensorflow. Some background information about the problem I was facing a challenge since I am interested in training a model which will among other things detect also weapons. My regular point of view is from a drone but I couldn't find any publicly available dataset from this point of...
0
1
245
0
51,935,221
0
0
0
0
1
false
3
2018-08-20T16:35:00.000
4
2
0
Is it okay to have non-trainable params in machine learning?
51,935,097
0.379949
python,machine-learning,keras,hyperparameters
Usually, non-trainable params does not mean some weights to which you assign random or predefined values (there would be no way to know the correct values, as they depend on the other weight values). It means some architectural decisions that you have made a priori. For example, in a neural network , such parameters wo...
When building a model for machine learning, is it okay to have non-trainable params? Or does this create errors in the model? I'm confused as to what non-trainable params actually are and how to fix your model based on that.
0
1
3,816
0
51,938,930
0
0
0
0
1
false
0
2018-08-20T21:40:00.000
0
2
0
Neural Network Regression
51,938,859
0
python-3.x,tensorflow,neural-network,keras,regression
When you test a case from X with NN0, and it tells you "I'm a 0", that's the exact same thing as it telling you "I'm not a 1", because your class set has size two, like a boolean. Therefor, your NN0 network predicts 1s as well as 0s, so does your NN1.
I had a question, For a given data set X with two classes {0,1}. If I train two separate neural networks NN0 and NN1 for each class 0 and 1 respectively. Can NN0 predict points in the dataset from class 1, even though it was trained on class 0?
0
1
75
0
51,939,645
0
0
0
0
2
true
6
2018-08-20T22:50:00.000
9
2
0
Keras Conv1D or Convolution1D
51,939,468
1.2
python,keras
They are just for different keras versions, before Keras 2.0 the layers were called ConvolutionalND for N = 1, 2, 3, and since Keras 2.0 they are just called ConvND.
I came across multiple implementations of a CNN in Keras and noticed that some people use Conv1D from from keras.layers.convolutional import Conv1D and others use Convolution1D from from keras.layers import Convolution1D. Is there a difference or an advantage to either one or are they possibly simply just different ver...
0
1
2,001
0
53,997,197
0
0
0
0
2
false
6
2018-08-20T22:50:00.000
-4
2
0
Keras Conv1D or Convolution1D
51,939,468
-1
python,keras
It's not about the versions. The n stands for the dimension of data, for e.g. if you are using a text data you use n=1 i.e. convolution1d. The value of n=2 is used for images. The value for n=3 goes for mri or ct scan. So, depending on the dimensions we use the value.
I came across multiple implementations of a CNN in Keras and noticed that some people use Conv1D from from keras.layers.convolutional import Conv1D and others use Convolution1D from from keras.layers import Convolution1D. Is there a difference or an advantage to either one or are they possibly simply just different ver...
0
1
2,001
0
51,961,029
0
0
0
0
1
false
1
2018-08-21T13:16:00.000
0
1
0
Is there a way to apply FFT to an unevenly spaced time series?
51,949,595
0
python-3.x,fft
You can try creating a new evenly spaced set of samples, Y', by interpolation. Then FFT Y'. How well this works depends on well the form of interpolation you choose matches the physics that produced your original Y,X data.
i have two series X and Y. X contains time values and Y contains a real function values for those times. I wish to perform FFT of the Y signal in python. The problem is that X is unevenly spaced: X(n+1)-X(n) /= constant. Is there a known way to apply FFT to such data ?
0
1
386
0
51,960,145
0
1
0
0
1
false
0
2018-08-22T03:59:00.000
0
1
0
how to set env if python,pandas are installed in local dir
51,959,670
0
python,pandas
If you install in a virtualenv, then activating the virtualenv will take care of that for you. Otherwise, add the dir to your PYTHONPATH environment variable. (How this is done depends on your operating system.)
If python,numpy,pandas are installed in local dir,how to set env ,so that ,import numpy as np,import pandas as pd can work.
0
1
37
0
51,976,804
0
0
0
0
1
true
3
2018-08-22T10:25:00.000
1
1
0
Downsampling point clouds to specific number of points while retaining shape
51,964,798
1.2
python,numpy,point-clouds,downsampling
Unfortunately, the answer is no. The number of output points using PCL's VoxelGrid is always going to be a function of the number of occupied voxels. The only way to control the number of occupied voxels is by altering the leaf size, and there is no dynamic way of doing this. Alternately, you may have luck using Farthe...
Environment: Python-PCL, WIndows 10, Python 3.6 I need to downsample point clouds to a specific number of points. These point clouds vary in size and hence I am stuck. From going through documentation, I understand there are only VoxelGrid, ConditionalOutlierRemoval ,StatisticalOutlierRemoval and RadiusOutlierRemoval ...
0
1
3,390
0
52,174,746
0
0
1
0
1
true
0
2018-08-22T12:17:00.000
0
1
0
Abaqus: parametric geometry/assembly in Inputfile or Python script?
51,966,721
1.2
python,abaqus
In case someon is interested, i was able to do it the following way: I created a model in abaqus till the point, i could have started the job. Then i took the .jnl file (which is created automaticaly by abaqus) and saved it as a .py file. Then i modified this script by defining every single point as a variable and ever...
i want to do something as a parametric study in Abaqus, where the parameter i am changing is a part of the assembly/geometry. Imagine the following: A cube is hanging on 8 ropes. Each two of the 8 ropes line up in one corner of a room. the other ends of the ropes merge with the room diagonal of the cube. It's somethin...
0
1
854
0
56,978,954
0
0
0
0
1
false
2
2018-08-22T12:57:00.000
0
1
0
Pandas DataFrame Display in Jupyter Notebook
51,967,445
0
python,pandas,jupyter-notebook
If df is a pandas.DataFrame object. You can do: df.style.set_properties(**{'max-width': '200px', 'font-size': '15pt'})
I want to make my display tables bigger so users can see the tables better when that are used in conjunction with Jupyter RISE (slide shows). How do I do that? I don't need to show more columns, but rather I want the table to fill up the whole width of the Jupyter RISE slide. Any idea on how to do that? Thanks
0
1
509
0
58,063,570
0
0
0
0
1
false
15
2018-08-23T08:10:00.000
3
3
0
How to change Keras/tensorflow version in Google colab?
51,981,095
0.197375
python,tensorflow,keras,google-colaboratory
In the latest colab, when you upgrade or downgrade a module, in the output cell you will automatically see the statement: "WARNING: The following packages were previously imported in this runtime: [scipy] You must restart the runtime in order to use newly installed versions. " asking you to restart the runtime along ...
I'm using keras/tensorflow on google colaboratory and I need to go back to previous versions of them. The problem is when I run !pip install q keras==1.2.2 , the kernel shows keras 1.2.2 installed but when I check it using keras.__version_ it shows 2.1.6 . And same case is with tensorflow. How do I fix this?
0
1
28,843
0
52,438,763
0
0
0
0
1
false
7
2018-08-23T12:58:00.000
1
2
0
DeprecationWarning: numpy.core.umath_tests
51,986,414
0.099668
python,scikit-learn
Alright so this is a deprecation warning on Python 3.x. Since, this is warning your code will run fine. It is not an error (When the code stops running by graceful degradation). The solution to remove this error is as follow: As I can see you have Scikit-Learn version 0.19.2 installed you need to get the latest vers...
I'm trying to run this python script below: import pandas as pd from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import accuracy_score from sklearn.metrics import confusion_matrix It gives me the error below. Warning (from warnings module): ...
0
1
10,943
0
51,989,369
0
1
0
0
1
false
0
2018-08-23T14:10:00.000
0
1
0
python-openCV module not found error
51,987,825
0
python,opencv,anaconda
Your openCV is probably installed in another python version and pylint is having problem identifying. Try to locate where your openCV is installed and manually change it.
I am getting this error -"module 'cv2' has no attribute 'version' when I try to find version of cv2, but my import is executing fine without any error. I am confused about whether my openCV is working correctly or not?
0
1
94
0
51,993,668
0
0
0
0
1
true
1
2018-08-23T19:57:00.000
4
1
0
Function to create a non equally spaced array in numpy
51,993,428
1.2
python,numpy
Yes, there is also logspace and geomspace in NumPy. np.geomspace(1,32,6) gives you array([ 1., 2., 4., 8., 16., 32.])
I would like to create an array with the form [1, 2, 4, 8, 16, 32, ...]. Not always with that spacing between numbers. Is there a linspace/arange type function which allows me to create vector of non equally spaced numbers? Thanks
0
1
663
0
51,994,159
0
1
0
0
1
true
0
2018-08-23T20:53:00.000
2
2
0
Sort a list, but leave a specified value in place
51,994,112
1.2
python,arrays,sorting
Locate and remove each of the values to ignore, remembering their positions. For instance, in this case, you might store the index and value as ignore = (3, -1). Sort the remaining list as usual. Reinsert the missing element: mylist.insert(ignore[0], ignore[1]) Does that get you moving?
I need to use the numpy.argsort function (or a code that makes the same) but ignoring a concrete value, for example -1, and keeping it in the resulted array If this is the list: [5,8,1,-1,2,4], I need a result like [3,4,0,-1,1,2] How can I do it?
0
1
203
0
52,016,745
0
0
0
0
1
true
0
2018-08-24T08:18:00.000
0
2
0
Python - How to remove duplicates in huge CSV file (200+ Million rows)
52,000,223
1.2
python,pandas,csv,dataframe,duplicates
Two possible approaches: SQL Select Distinct Load the CSV file into a database and us SQL Select Distinct and export the query result as a Csv file. Some database let you define a CSV file as a table and let you run SQL queries on the CSV file Select distinct URL from UrlTable Sort the File You could Sort the file on...
We made an Image recognition API that accepts image URL and responds an image description. This process takes about 5-20 seconds. I have a huge CSV file with 200+ million rows of image URLs scraped from different sources. I found that the CSV file has duplicate image URLs from different sources. So I don't need to send...
0
1
995
0
52,006,897
0
0
0
0
1
false
1
2018-08-24T14:36:00.000
0
1
0
how to add the overall "precision" and "recall" metrics to "tensorboard" log file, after training is finished?
52,006,745
0
python,tensorflow,keras,tensorboard,precision-recall
I believe that you've already done that work: it's the same process as the validation (prediction and check) step you do after training. You simply tally the results of the four categories (true/false pos/neg) and plug those counts into the equations (ratios) for precision and recall.
After the training is finished and I did the prediction on my network, I want to calculate "precision" and "recall" of my model, and then send it to log file of "tensorboard" to show the plot. while training, I send "tensorboard" function as a callback to keras. but after training is finished, I dont know how to add so...
0
1
289
0
52,007,874
0
0
0
0
1
false
0
2018-08-24T15:27:00.000
0
1
0
Pandas find columns with unique values
52,007,555
0
python,sql,pandas,dataframe
Use the Python library that allows you to query your database (pymysql, psycopg2, etc). Programmatically use the metadata available from the DB to iterate over the tables and columns. Dynamically create the SQL queries to compare "select count(field) - count(distinct field) from table". Or you could also potentially u...
I have two databases (each with 1000's of tables) which are supposed to reflect the same data but they come from two different sources. I compared two tables to see what the differences were, but to do that I joined the two on a common ID key. I checked the table manually to see what the ID key was, but when I have to ...
0
1
64
0
52,547,503
0
1
0
0
1
true
2
2018-08-25T14:48:00.000
0
1
0
how matplotlib create and deliver plot to jupyter notebook?
52,018,374
1.2
python,matplotlib,jupyter-notebook
The inline backend essentially calls fig.savefig(buffer, format="png", bbox_inches="tight") where fig is the figure to show. It'll then supply the content of buffer inside a <img> tag in the jupyter's output section.
In jupyter notebook, we can use %matplotlib inline to guide inline the image created by python script. Can anyone give a 5 sentence explaining what is happening under the hood to make that happen? If i'd like to have some web page to host the matplotlib created plot, is that possible or not? thanks~
0
1
53
0
52,029,914
0
0
0
0
1
true
2
2018-08-26T20:08:00.000
1
1
0
Does the loss in tensorflow.train.AdamOptimizer have to be positive?
52,029,879
1.2
python,tensorflow,loss
Yes you can. As long as it is a minimization instead of maximization, everything should be exactly the same as in the examples.
My question is quite a simple one: My intention is to minimize loss=a-b where loss is ideally as big a negative number as possible, ie. b much bigger than a. Since in all the examples, the loss is positive, I wanted to ask whether I can just input my loss into compute_gradients and get the desired result. Cheers
0
1
143
0
52,031,095
1
0
0
0
1
false
0
2018-08-26T21:19:00.000
0
1
0
How can I find the number of unique undirected edges of a graph using networkx?
52,030,344
0
python,graph,networkx
You have to convert the graph to an undirected graph the calculate the size. NetworkX does not have a function that does this in one shot like snap does. networkx_Graph.to_undirected().size()
I have a directed bigraph that contains directed and undirected edges. networkx_Graph = nx.read_adjlist('graph.txt', create_using=nx.DiGraph()) I was able to find the number of directed edges using: len(list(networkx_Graph.in_edges(data=False))) But I am trying to find the number of undirected edges. This is quite easy...
0
1
372
0
52,032,920
0
0
0
0
1
false
0
2018-08-27T04:24:00.000
0
2
0
Does the squared error depends on the number of hidden layers?
52,032,541
0
python,neural-network
Though this is not a programming question, I'll try my best to answer it here. The squared error, i.e. the 'loss' of your neural network, depends on your neural network prediction and the ground truth. And it is convex from its definition. The reasons that you're not getting low losses could be: You're not normalizing...
I wanted to know if the squared error depends also on the number of hidden layers and the number of neurons on each hidden layer , because I've created a neuron network with one hidden layer but I can't reach a small squared error , so maybe the function is not convex ? Can I optimize weights by adding more hidden laye...
0
1
34
0
54,873,735
0
0
0
0
1
true
7
2018-08-27T21:20:00.000
2
1
0
Convolutional neural network architectures with an arbitrary number of input channels (more than RGB)
52,047,126
1.2
python,tensorflow,image-processing,keras,conv-neural-network
If you retrain the models, that's not a problem. Only if you want to use a trained model, you have to keep the input the same.
I am very new to image recognition with CNNs and currently using several standard (pre-trained) architectures available within Keras (VGG and ResNet) for image classification tasks. I am wondering how one can generalise the number of input channels to more than 3 (instead of standard RGB). For example, I have an image ...
0
1
315
0
52,051,400
0
0
0
0
1
false
1
2018-08-28T06:22:00.000
1
1
0
Difference between arima.predict() and arima.forecast()
52,051,348
0.197375
python,machine-learning,time-series,arima
They will give you the same answers. But the combination of Arima (not arima) and forecast from the forecast package are enhanced versions with additional functionality. Arima calls stats::arima for the estimation, but stores more information in the returned object. It also allows some additional model functionality su...
What is difference between arima.predict() and arima.forecast(). Which function should use for forecasting time series in python?
0
1
1,974
0
52,059,673
0
0
0
0
1
true
0
2018-08-28T13:52:00.000
8
2
0
how to detect upside down face?
52,059,560
1.2
python,opencv,computer-vision,face-detection,dlib
You could use the same library to detect upside down faces. If the library is unable to detect the face initially, transform it 180° and check again. If it is recognized in this condition, you know it was an upside down face.
I would like to detect upright and upside-down faces, however faces weren't recognized in upside-down images. I used the dlib library in Python with shape_predictor_68_face_landmarks.dat. Is there a library that can recognize upright and upside-down faces?
0
1
855
0
52,061,923
0
0
0
0
1
true
0
2018-08-28T15:48:00.000
3
1
0
Transform square matrix into 1D array with NumPy
52,061,828
1.2
python,arrays,numpy,matrix
Use the reshape method: array = matrix.reshape((1,400)). This works for both Numpy Array and Matrix types. UPDATE: As sacul noted, matrix.reshape(-1) is more general in terms of dimensions.
Let's say I have a square matrix with 20 lines and 20 columns. Using NumPy, what should I do to transform this matrix into a 1D array with a single line and 400 columns (that is, 20.20 = 400, all in one line)? So far, I've tried: 1) array = np.ravel(matrix) 2) array = np.squeeze(np.asarray(matrix)) But when I print arr...
0
1
679
0
52,083,402
0
1
0
0
1
true
0
2018-08-29T17:09:00.000
1
1
0
Matplotlib in Tensorflow Jupyter Notebook
52,082,814
1.2
python,matplotlib,tensorflow,jupyter-notebook
Add import sys and sys.executable to the top of your notebook, then run it. This shows you the directory of the running kernel. With this information, from a new command-line (not a Python console) run C:\path\to\python.exe -m pip install matplotlib
In Anaconda Navigator, I switched to running applications on tensorflow and installed jupyter 5.6.0. I then open up a Python3 notebook. I then import tensorflow, keras and numpy without issue. Then when I try to import matplotlib, the notebook says ImportError: No module named 'matplotlib'. I tried running the followi...
0
1
940
0
52,091,386
0
0
0
0
1
true
0
2018-08-29T17:41:00.000
4
1
0
Add python_opencv in buildroot image
52,083,346
1.2
python-3.x,opencv,buildroot
Back when opencv was introduced in Buildroot, there was indeed no numpy package, so support for doing OpenCV in Python could not be added, hence this comment. But since then, a python-numpy package was added, and it is even used in the opencv3 package to provide Python support. So, the opencv package simply needs to be...
How can I generate an image using buildroot with opencv2 in it? In "Target Packages->Libraries->Graphics->opencv2.4" says that python_opencv depends on numpy, which isn't available. An self made app(which is in the built image as well) uses python3.6 and opencv2. Buildroot Version: 2017.08-rc3
0
1
753
0
57,507,051
0
0
0
0
1
false
69
2018-08-29T21:52:00.000
7
3
0
Pandas isna() and isnull(), what is the difference?
52,086,574
1
python,pandas
They both are same. As a best practice, always prefer to use isna() over isnull(). It is easy to remember what isna() is doing because when you look at numpy method np.isnan(), it checks NaN values. In pandas there are other similar method names like dropna(), fillna() that handles missing values and it always helps t...
Pandas has both isna() and isnull(). I usually use isnull() to detect missing values and have never met the case so that I had to use other than that. So, when to use isna()?
0
1
28,252
0
52,089,011
0
0
0
0
1
true
0
2018-08-30T01:29:00.000
0
1
0
In tf.layers.conv2d, with use_bias=True, are the biases tied or untied?
52,088,059
1.2
python,tensorflow
tied biases is used in tf.layers.conv2d. If you want united biases, just turn off use_bias and create bias variable manually with tf.Variable or tf.get_variable same shape with following feature map, finally sum them up.
One more question: If they are tied biases, how can I implement untied biases? I am using tensorflow 1.10.0 in python.
0
1
213
0
52,104,907
0
0
0
0
1
true
0
2018-08-30T20:23:00.000
4
1
0
Confidence intervals via bootstrapping
52,104,841
1.2
python,statistics-bootstrap
This question isn't related to Python. I think you need to read an intro to bootstrapping. "An Introduciton to Statistical Learning" provides a good one. The idea is not to sample 100 -- you must sample with replacement and taking the same sample size (500). Yes, then you reestimate your parameter many times. And then ...
Yesterday I began to read about using bootstrapping to determine confidence intervals (CIs) in many situations. My current situation is that I am trying to estimate three parameters in a model via maximum likelihood estimation (MLE). This I have done, and now I need to define my CIs. This can obviously be done via prof...
0
1
763
0
71,774,912
0
0
0
0
1
false
35
2018-09-02T01:38:00.000
0
2
0
How can I clear a model created with Keras and Tensorflow(as backend)?
52,133,347
0
python,tensorflow,keras,jupyter-notebook
I know it is a bit old thread, but I was looking for something to clear the session. For TensorFlow 2.8 I think you need to use tf.keras.backend.clear_session()
I have a problem when training a neural net with Keras in Jupyter Notebook. I created a sequential model with several hidden layers. After training the model and saving the results, I want to delete this model and create a new model in the same session, as I have a for loop that checks the results for different paramet...
0
1
47,667
1
52,140,437
0
0
0
0
1
false
1
2018-09-02T19:25:00.000
1
3
0
Create a basic Python interface to save images drawn with a mouse
52,140,339
0.066568
python,image,user-interface,draw
I'd take a look at pyautogui to capture the mouse location then "draw" it in matplotlib -- should be able to do this in a loop. You'll want to watch the tkinter window size to sync the mouse coordinates with the relative location. Why not just have your script open create a new blank img and automatically open it with ...
I am working on the following project and I am having really difficulties in finding the right way of doing that. I would like to build in Python (but I am open to other possibilities) a very basic interface that allows the user to draw with the mouse (or the pen if used on a surface laptop) something and then save the...
0
1
1,360
0
71,867,816
0
0
0
0
1
false
0
2018-09-03T02:29:00.000
0
1
0
Numpy array size different when saved to disk (compared to nbytes)
52,142,524
0
python,numpy
For others references, From numpy documentation: numpy.ndarray.nbytes attribute ndarray.nbytes Total bytes consumed by the elements of the array. Notes Does not include memory consumed by non-element attributes of the array object. So, the nbytes just considers elements of the array.
Is it possible that a flat numpy 1d array's size (nbytes) is 16568 (~16.5kb) but when saved to disk, has a size of >2 mbs? I am saving the array using numpy's numpy.save method. Dtype of array is 'O' (or object). Also, how do I save that flat array to disk such that I get approx similar size to nbytes when saved on di...
0
1
138
0
52,145,089
0
0
0
0
1
false
4
2018-09-03T07:02:00.000
2
2
0
Online Learning with Tensorflow
52,144,642
0.197375
python,tensorflow,machine-learning,reinforcement-learning
You don't need to re-initialize the graph. Tensorflow is not explicitly aware of whether you're doing the training or testing phase when you request the output tensor. Rather, back propagation happens whenever you evaluate the optimizer's (e.g. tf.train.AdamOptimizer, tf.train.GradientDescentOptimizer, etc) minimize op...
My problem is related to building a recommender system. I am using tensorflow to train the model with user_features, item_features and interactions. How can i handle new data? For example, whenever a use clicks on an item, i wanna record that interaction immediately and learn from that interaction (training the model ...
0
1
4,565
0
52,182,820
0
0
0
0
1
false
0
2018-09-03T16:33:00.000
0
1
0
External database lookup in TF serving or part of the TF graph
52,153,548
0
python,tensorflow,tensorflow-serving
I'd say that you could wrap the TF server in something like a flask app, which takes in a REST request, applies the additional logic (the DB lookup), and populates and sends a request to the TF server (either via HTTP or gRPC). I don't think it would be possible to do it as 'part of the TF graph'.
I have an tensorflow model that I'm planning to deploy using tensorflow serving for model inference. Just wondering if there is a way to add some custom logic after the service receives the request and before it goes to the tensorflow model. Specifically, I need a lookup step from an external database, that would enri...
1
1
57
0
52,159,197
0
0
0
0
1
false
1
2018-09-04T04:53:00.000
1
1
0
WEKA and Scikit-Learn Multilayer Perceptron Gives Different Result
52,159,019
0.197375
python,scikit-learn,weka
If you train a neural net with a different optimizer, it will certainly give different results. This difference could be slight or tremendous. All NN optimization algorithms use backpropagation - i.e., LBFGS, Adam, and SGD all use backpropagation. Also - in general - training the same NN twice will likely never give yo...
everyone I'm currently running a research using Multilayer perceptron. I previously run this using WEKA but I have migrated to scikit-learn in python for various reason. I tried to reproduce my prediction results in WEKA to scikit-learn so I made an exact perceptron with the exact same learning rate, momentum, hidden l...
0
1
318
0
57,736,414
0
0
0
0
5
false
20
2018-09-04T08:28:00.000
2
9
0
I am having trouble with this error (-215:Assertion failed) !ssize.empty() in function 'resize' in OpenCV
52,162,004
0.044415
python,opencv,keras
Just enter the precise image format. .jpg instead of .jpeg.
I am trying to apply a Keras' image classifier to my project, but down the road I got stuck with this. Though previously, with the same code I could use OpenCV to read and train images, but after switching to a new batch of images it got caught with the error. So my speculation is that there's something wrong with my f...
0
1
78,798
0
67,135,915
0
0
0
0
5
false
20
2018-09-04T08:28:00.000
1
9
0
I am having trouble with this error (-215:Assertion failed) !ssize.empty() in function 'resize' in OpenCV
52,162,004
0.022219
python,opencv,keras
In my case there were special characters in the file name. Like "ü", "ä", "/", etc. I had to make a choice: Renaming automatically or just raise an error for the user to know, that the pictures have bad names.
I am trying to apply a Keras' image classifier to my project, but down the road I got stuck with this. Though previously, with the same code I could use OpenCV to read and train images, but after switching to a new batch of images it got caught with the error. So my speculation is that there's something wrong with my f...
0
1
78,798
0
63,875,303
0
0
0
0
5
false
20
2018-09-04T08:28:00.000
-1
9
0
I am having trouble with this error (-215:Assertion failed) !ssize.empty() in function 'resize' in OpenCV
52,162,004
-0.022219
python,opencv,keras
Put double backslashes in your path inside the imread function.
I am trying to apply a Keras' image classifier to my project, but down the road I got stuck with this. Though previously, with the same code I could use OpenCV to read and train images, but after switching to a new batch of images it got caught with the error. So my speculation is that there's something wrong with my f...
0
1
78,798
0
67,938,301
0
0
0
0
5
false
20
2018-09-04T08:28:00.000
0
9
0
I am having trouble with this error (-215:Assertion failed) !ssize.empty() in function 'resize' in OpenCV
52,162,004
0
python,opencv,keras
I was facing a similar problem because I was reading multiple images from a directory and that directory had a pdf file(silly), so make sure your specified paths have only images.
I am trying to apply a Keras' image classifier to my project, but down the road I got stuck with this. Though previously, with the same code I could use OpenCV to read and train images, but after switching to a new batch of images it got caught with the error. So my speculation is that there's something wrong with my f...
0
1
78,798
0
65,369,786
0
0
0
0
5
false
20
2018-09-04T08:28:00.000
0
9
0
I am having trouble with this error (-215:Assertion failed) !ssize.empty() in function 'resize' in OpenCV
52,162,004
0
python,opencv,keras
For me, I had my camera app open in Windows 10, and that's why I was getting that error. I shut it down and reran my code and it worked.
I am trying to apply a Keras' image classifier to my project, but down the road I got stuck with this. Though previously, with the same code I could use OpenCV to read and train images, but after switching to a new batch of images it got caught with the error. So my speculation is that there's something wrong with my f...
0
1
78,798
0
52,321,037
0
1
0
0
1
true
1
2018-09-04T09:18:00.000
1
1
0
Is it possible to use custom build cpython in Anaconda environment?
52,162,907
1.2
python,scipy,anaconda,conda,cpython
I was able to resolve my issue by replacing only python DLL that I had in, and the conda environment just worked with it
I build a cpython locally (Windows) with a fix to a problem with multiprocessing that I have, but I also need data science stack of packages like numpy, pandas, scipy, matplotlib, statsmodels and few others. When I try to install them the process appears quite cubersome for many packages and for scipy I wasn't able to ...
0
1
322
0
70,050,317
0
0
0
0
1
false
67
2018-09-04T19:53:00.000
1
3
0
Getting a list of indices where pandas boolean series is True
52,173,161
0.066568
python,pandas,boolean,series,boolean-indexing
Also works: s.where(lambda x: x).dropna().index, and it has the advantage of being easy to chain pipe - if your series is being computed on the fly, you don't need to assign it to a variable. Note that if s is computed from r: s = cond(r) than you can also use: r.where(lambda x: cond(x)).dropna().index.
I have a pandas series with boolean entries. I would like to get a list of indices where the values are True. For example the input pd.Series([True, False, True, True, False, False, False, True]) should yield the output [0,2,3,7]. I can do it with a list comprehension, but is there something cleaner or faster?
0
1
70,848
0
60,923,830
0
1
0
0
1
false
4
2018-09-04T22:00:00.000
1
2
0
ModuleNotFoundError: No module named 'keras'
52,174,530
0.099668
python,tensorflow,keras
When you start a project in PyCharm, there is an option to use an existing virtual environment or create a new virtual environment. If nothing mentioned while creating the project, new virtual environment will be created. If that is the case, there is no Keras in the new environment which is possibly your issue. It wi...
I can't import Keras in PyCharm IDE on a Mac. I have tried installing and uninstalling Keras using both pip, pip3, conda, and easy install, but none worked. I have tried changing interpreters (Python 2.7 and 3.6) but neither worked. In a terminal, when I run: pip3 list | grep -i keras I get: Keras ...
0
1
14,633