When adding new coding inside the train.py. The new coding I add is needed to print out the confusion matrix, but after that, the new coding inside the train.py didn’t show anything.
The coding i add inside as shown below:
accuracy = torchmetrics.Accuracy(
precision = torchmetrics.Precision(
dice = torchmetrics.Dice(
average_precision = torchmetrics.AveragePrecision(
precision_recall = torchmetrics.PrecisionRecallCurve(
AUC = torchmetrics.AUC(
F1_Score = torchmetrics.F1Score(
confusion_matrix = torchmetrics.ConfusionMatrix(
preds = torch.tensor([1, 0.4, 0.8, 0.4])
target = torch.tensor([1, 1, 0, 0])
dice = get_Dice()
accuracy = get_Accuracy(1)
average_precision = get_Average_precision(1)
precision = get_Precision(1)
confusion_matrix = get_Confusion_Matrix()
# result = accuracy(preds, target)
acc = accuracy(preds, target)
confusion = confusion_matrix(preds, target)
result = precision(preds, target)
print(acc, result, confusion)
Except confusion matrix, do you get acc and result output log?
Which train.py are you using?
Is it the below one? But the source looks very different compared to the content you shared.
This file has been truncated.
# Note -- this training script is tweaked from the original at:
# For a step-by-step guide to transfer learning with PyTorch, see:
import torch.nn as nn
I using the jetson inference train.py
There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.
Could you share which script you are using with us?
February 21, 2023, 6:40am
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.