我有一个python 2.7代码将其翻译成python 3.6代码。
当我跑步时:
from cvxopt import solvers, matrix
(...)
P = matrix(P)
q = matrix(q)
G = matrix(G)
h = matrix(h)
A = matrix(A)
b = matrix(b)
sol = solvers.qp(P, q, G, h, A, b)
我收到此错误:
Traceback (most recent call last):
File "C:\Users\jaime.lazcano\Documents\Projects\myproject\optimization.py", line 85, in run_optimizacion
sol = solvers.qp(P, q, G, h, A, b)
File "C:\ProgramData\Anaconda2\envs\myproject\lib\site-packages\cvxopt\coneprog.py", line 4487, in qp
return coneqp(P, q, G, h, None, A, b, initvals, kktsolver = kktsolver, options = options)
File "C:\ProgramData\Anaconda2\envs\myproject\lib\site-packages\cvxopt\coneprog.py", line 2243, in coneqp
if iters == 0: W = misc.compute_scaling(s, z, lmbda, dims)
File "C:\ProgramData\Anaconda2\envs\myproject\lib\site-packages\cvxopt\misc.py", line 285, in compute_scaling
W['d'] = base.sqrt( base.div( s[mnl:mnl+m], z[mnl:mnl+m] ))
ValueError: domain error
该代码在python 2.7上有效,但在python 3.6上无效。
我不知道python 3.6的格式是什么