当前位置:网站首页>How to hide cvxpy warnings: warn: a- > P (column pointers) not strictly increasing, column x empty?
How to hide cvxpy warnings: warn: a- > P (column pointers) not strictly increasing, column x empty?
2022-07-03 10:39:00 【serity】
The problem background
Recently in use python When programming to solve problems related to Quantum Computing , It involves positive semidefinite programming with complex matrices (SDP), stay google I searched the Internet for some discoveries cvxpy Is the most suitable for this problem . It's not easy to finish coding , The following warnings always appear when running the program ( Every run is the same error ):
WARN: A->p (column pointers) not strictly increasing, column 3 empty
WARN: A->p (column pointers) not strictly increasing, column 6 empty
WARN: A->p (column pointers) not strictly increasing, column 10 empty
WARN: A->p (column pointers) not strictly increasing, column 13 empty
WARN: A->p (column pointers) not strictly increasing, column 17 empty
WARN: A->p (column pointers) not strictly increasing, column 20 empty
WARN: A->p (column pointers) not strictly increasing, column 24 empty
WARN: A->p (column pointers) not strictly increasing, column 27 empty
in fact , My program can run through , And the result is also right , But the above warning will pop up before the result comes out , It affects the beauty and prevents me from seeing the results , So I made up my mind to eliminate this warning .
To solve the process
stay github After shopping around, I got the following conclusion :
- cvxpy In solving SDP The default is SCS solver
- SCS and CVXOPT Solvers often pop up warnings , But later CVXOPT This one of bug It's fixed
- Big guys recommend using more robust The solver :MOSEK
install MOSEK
Because of my own IDE yes Visual Studio Code, And it USES the Anaconda Environment , So after getting the above conclusion, I decided to use conda install -c mosek mosek To install MOSEK.
After installation, use the following command to detect MOSEK Is the installation successful ( If no error is reported, the installation is considered successful ):
import mosek
If there is such a mistake :
cvxpy.error.SolverError: The solver MOSEK is not installed.
You need to download the corresponding distribution:https://www.mosek.com/downloads/

You can choose to download according to your own operating system , After installation, you need to configure environment variables , I assume you are Windows 64 Users and MOSEK The installation path for is X:\Program Files\Mosek, Then you need to X:\Program Files\Mosek\9.3\tools\platform\win64x86\bin Add to environment variables PATH In the middle ( Not Windows Users can directly refer to Official documents ).
License To configure
After installation , You need to configure License Can be used MOSEK.
If it's the student party , Suggested choice Academic Licenses, Because it has the 365 Free trial period of days ( And can extend ), Related website :https://www.mosek.com/license/request/personal-academic/
Fill in the mailbox of your school , The general domain name is XXX.edu.cn, At the bottom of the Organization Just fill in the English name of your school .
After that, the official will send an email to your mailbox , The attachment is mosek.lic, Put it on
C:\Users\ Your username \mosek\
It's OK , without mosek Folder , Then create one manually !
GLPK And GLPK_MI Related issues
In fact, it's over here , But some of my friends may encounter the following mistakes like me :
Encountered unexpected exception importing solver GLPK
Encountered unexpected exception importing solver GLPK_MI
At this point, just switch to the corresponding conda Environmental Science , And then execute
conda uninstall glpk
That's it . It may take a long time , Just wait patiently .
边栏推荐
- Leetcode skimming ---367
- Julia1.0
- Linear regression of introduction to deep learning (pytorch)
- Leetcode刷题---1
- Jetson TX2 刷机
- Raspberry pie 4B deploys lnmp+tor and builds a website on dark web
- Hands on deep learning pytorch version exercise answer - 2.2 preliminary knowledge / data preprocessing
- Leetcode skimming ---263
- Softmax 回归(PyTorch)
- Data preprocessing - Data Mining 1
猜你喜欢

6、 Data definition language of MySQL (1)

Hands on deep learning pytorch version exercise answer - 2.2 preliminary knowledge / data preprocessing

Boston house price forecast (tensorflow2.9 practice)

Realize an online examination system from zero

Ut2017 learning notes

Ut2013 learning notes

【吐槽&脑洞】关于逛B站时偶然体验的弹幕互动游戏魏蜀吴三国争霸游戏的一些思考

Leetcode刷题---367

Tensorflow—Neural Style Transfer

Model selection for neural network introduction (pytorch)
随机推荐
丢弃法Dropout(Pytorch)
[LZY learning notes dive into deep learning] 3.4 3.6 3.7 softmax principle and Implementation
High imitation Netease cloud music
Leetcode刷题---1
Leetcode skimming ---189
Convolutional neural network (CNN) learning notes (own understanding + own code) - deep learning
Leetcode刷题---977
Standard library header file
Training effects of different data sets (yolov5)
MySQL reports an error "expression 1 of select list is not in group by claim and contains nonaggre" solution
CSDN, I'm coming!
User recommendation preference model based on attention enhanced knowledge perception
【吐槽&脑洞】关于逛B站时偶然体验的弹幕互动游戏魏蜀吴三国争霸游戏的一些思考
2-program logic
Ut2013 learning notes
6、 Data definition language of MySQL (1)
conda9.0+py2.7+tensorflow1.8.0
Leetcode刷题---832
六、MySQL之数据定义语言(一)
神经网络入门之预备知识(PyTorch)