当前位置:网站首页>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 .
边栏推荐
- Content type ‘application/x-www-form-urlencoded; charset=UTF-8‘ not supported
- ThreadLocal principle and usage scenario
- 2-program logic
- Mysql5.7 installation and configuration tutorial (Graphic ultra detailed version)
- A complete mall system
- Judging the connectivity of undirected graphs by the method of similar Union and set search
- Leetcode skimming ---202
- ThreadLocal原理及使用场景
- mysql5.7安装和配置教程(图文超详细版)
- Leetcode skimming ---10
猜你喜欢

A complete mall system

Ut2014 supplementary learning notes

High imitation wechat

Tensorflow—Image segmentation

Hands on deep learning pytorch version exercise solution - 2.4 calculus

Knowledge map reasoning -- hybrid neural network and distributed representation reasoning

Raspberry pie 4B installs yolov5 to achieve real-time target detection

八、MySQL之事务控制语言

Jetson TX2 brush machine

A complete answer sheet recognition system
随机推荐
Ut2017 learning notes
Judging the connectivity of undirected graphs by the method of similar Union and set search
【吐槽&脑洞】关于逛B站时偶然体验的弹幕互动游戏魏蜀吴三国争霸游戏的一些思考
深度学习入门之自动求导(Pytorch)
Hands on deep learning pytorch version exercise solution - 2.6 probability
Ut2014 supplementary learning notes
Leetcode skimming ---189
Content type ‘application/x-www-form-urlencoded;charset=UTF-8‘ not supported
What useful materials have I learned from when installing QT
Knowledge map reasoning -- hybrid neural network and distributed representation reasoning
[LZY learning notes dive into deep learning] 3.5 image classification dataset fashion MNIST
神经网络入门之矩阵计算(Pytorch)
Binary search method
8、 Transaction control language of MySQL
八、MySQL之事务控制语言
MySQL报错“Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggre”解决方法
Ut2013 learning notes
EFFICIENT PROBABILISTIC LOGIC REASONING WITH GRAPH NEURAL NETWORKS
Mysql5.7 installation and configuration tutorial (Graphic ultra detailed version)
Multilayer perceptron (pytorch)