Hello,
To store all iterations results of y_true, and y_pred, i added all_y_true, all_y_pred. But when i try to plot ROC Curve, it shows ValueError: continuous format is not supported,  at line → 11 fpr, tpr, _ = roc_curve(y_true, y_pred)
Here is my code:

all_y_true = []
all_y_pred = []
for i, (x, y) in enumerate(zip(test_x, test_y)):
name = y.split("/")[-1].split(".")[0]
## Image
image = cv2.imread(x, cv2.IMREAD_GRAYSCALE)
image = cv2.resize(image, (128, 128))
image = np.expand_dims(image, axis=0)
image = image/255.0
image = np.expand_dims(image, axis=0)
image = image.astype(np.float32)
image = torch.from_numpy(image)
image = image.to(device)
## Mask
mask = cv2.imread(y, cv2.IMREAD_GRAYSCALE)
mask = cv2.resize(mask, (128, 128))
mask = np.expand_dims(mask, axis=0)
mask = mask/255.0
mask = np.expand_dims(mask, axis=0)
mask = mask.astype(np.float32)
mask = torch.from_numpy(mask)
#mask = mask.to(device)
all_y_true = np.append(all_y_true, mask)

# Shape
#print('image shape:', image1.shape, 'roi shape:', mask1.shape)

with torch.no_grad():
    pred_y1 = torch.sigmoid(model(image))
    y_pred = pred_y1.cpu().numpy()
    y_pred = y_pred > 0.5
    y_pred = y_pred.reshape(-1)
    y_pred = y_pred.astype(np.uint8)
    #y_pred.flatten()
    all_y_pred = np.append(all_y_pred, y_pred)

Calculate image-level ROC AUC score
y_true = all_y_true
y_pred = all_y_pred
fpr, tpr, _ = roc_curve(y_true, y_pred)
roc_auc = roc_auc_score(y_true, y_pred)
plt.figure(1)
plt.plot([0, 1], [0, 1], ‘k–’)
plt.plot(fpr, tpr, label=‘CNN(area = {:.3f})’.format(roc_auc))
plt.xlabel(‘False positive rate’)
plt.ylabel(‘True positive rate’)
plt.title(‘ROC curve’)
plt.legend(loc=‘best’)
plt.show()