Unable to retrieve attribute 'x'Answered
I keep getting unable to retrieve 'x' error
I need some direction which way to look for to fix this
Could you please help me on this, Thanks
def GeoIndCom(lst_num, eps):
x_list = z
dQ = metrics.euclidean
# delta = 1.05
for i in range(int(lst_num)):
p_matrix, pre_prob, post_prob = optql(x_list, pi_list, dQ, epsilon=eps)
f = open("./EM/EM_Uniform_41_" + str(eps) + ".txt", 'w')
for i in range(len(x_list)):
str_temp = ""
for j in range(len(x_list)):
str_temp = str_temp + str(p_matrix[i,j]) + ","
str_temp = str_temp[0:len(str_temp)-1] + "\n"
grid_num_list = [110.0]
eps_list = [5.0]
for i in range(len(grid_num_list)):
cur_grid_num = grid_num_list[i]
for k in range(len(eps_list)):
cur_eps = eps_list[k]
print("Grid Num: ", cur_grid_num)
print("Epsilon : ", cur_eps)
Note that the output you provide shows that you have an infeasible model, meaning no solution exists.
I can see in the traceback on the line ending in "line 278, in optql" that the optql function is trying to access the solution values (the "X" attribute) which of course do not exist if there is no solution.
The following article in our knowledge base may be a good starting point to help you understand why the model is infeasible: "How do I resolve the error Model is infeasible or unbounded"?
Please sign in to leave a comment.