Deci-AI / super-gradients

Easily train or fine-tune SOTA computer vision models with one open source training library. The home of Yolo-NAS.
https://www.supergradients.com
Apache License 2.0
4.52k stars 490 forks source link

No output on console #1289

Open Chandrakapure opened 1 year ago

Chandrakapure commented 1 year ago

💡 Your Question

I am trying to print the bounding box cordinates , labels and confidence , everything is working fine but it is not printing the output.

Code snippet

import cv2 from super_gradients.common.object_names import Models from super_gradients.training import models image = cv2.imread('Videos/test3.jpg') image = cv2.resize(image,(1000,500)) img = cv2.cvtColor(image, cv2.COLOR_BGR2RGB) model = models.get(Models.YOLO_NAS_L, pretrained_weights="coco") results = list(model.predict(img)) box = list(results[0].prediction.bboxes_xyxy) lab = list(results[0].prediction.labels) conf_list = list(results[0].prediction.confidence) print(box) print(lab) print(conf_list)

Versions

No response

BloodAxe commented 1 year ago

Any chance you are using 'silent_mode' in training hyperparameters?

Chandrakapure commented 1 year ago

Any chance you are using 'silent_mode' in training hyperparameters?

Silent_mode is set False, still no output getting printed.

BloodAxe commented 1 year ago

I can confirm this happens to me as well when using Colab.

ichu-apl commented 6 months ago

ah, I'm also experiencing this issue. It looks like something in the super_gradients library is redirecting stdout.

print("a")
from super_gradients.training import models
print("b")
print("c", flush=True)
crash=crash
print("d")
print("e", flush=True)

will only print "a" and then correctly crash at the crash=crash line

ichu-apl commented 5 months ago

You can wrap the import with a stored stdout to undo the redirect.

import sys
stdout = sys.stdout
from super_gradients.training import models
sys.stdout = stdout