Error during GAN model evaluation

I got this error while trying to evaluate my GAN model:
Code:

fpr, tpr, _ = roc_curve(labels, img_distance)
precision, recall, _ = precision_recall_curve(labels, img_distance)
roc_auc = auc(fpr, tpr)
pr_auc =  auc(recall, precision)

Output Error:

C:\Users\nafti\anaconda3\envs\st\lib\site-packages\sklearn\metrics\_ranking.py:943: UndefinedMetricWarning: No negative samples in y_true, false positive value should be meaningless
  UndefinedMetricWarning)

How can I solve it?

This warning is created by sklearn, as it seems that the target array doesn’t contain any negative samples, and thus the metric calculation would be meaningless.
You could check labels and make sure that it contains positive and negative samples.

I have positive and negative samples but I still got the same problem

Could you post the label tensor (or just a part of it containing the positive and negative samples) so that we could reproduce this issue, please?

I train the model on healthy patient and trying to test it on unhealthy patients.
but labels read only positive samples!

array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
       1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
       1, 1, 1, 1, 1, 1, 1, 1, 1])

This would explain the raised warning, since scikit-learn wouldn’t be able to calculate the metrics.
Is this a new issue now, as you’ve previously mentioned that you have both, positive and negative, labels?

My dataset contain both positive and negative but cannot be read, I think a problem in data splitting,
do have you any idea how can I split data in that case (train: healthy data and test: healthy and unhealthydata) because i did it manually but doesn’t work