Pytorch-yolov3: problem of detect.py

Created on 11 Jun 2019  路  4Comments  路  Source: eriklindernoren/PyTorch-YOLOv3

when I run detect.py, it shows :

File "detect.py", line 140
plt.savefig(f"output/{filename}.jpg", bbox_inches="tight", pad_inches=0.0)
^
SyntaxError: invalid syntax

Is it because of the Linux system? How to solve it?

Most helpful comment

I just delete "f" and add "format", it works for me, but I'm not sure whether it works for you:

plt.savefig("output/{}.jpg".format(filename), bbox_inches="tight", pad_inches=0.0)

All 4 comments

I just delete "f" and add "format", it works for me, but I'm not sure whether it works for you:

plt.savefig("output/{}.jpg".format(filename), bbox_inches="tight", pad_inches=0.0)

when I run detect.py, it shows :

File "detect.py", line 140
plt.savefig(f"output/{filename}.jpg", bbox_inches="tight", pad_inches=0.0)
^
SyntaxError: invalid syntax

Is it because of the Linux system? How to solve it?

"f-string" can't be used in python3.5 and previous versions of python. What's your version of python ?

Whats your cls_conf, mine is always 1.0, I think its not right

  • Label: without_mask, Conf: 1.00000

Whats your cls_conf, mine is always 1.0, I think its not right

  • Label: without_mask, Conf: 1.00000

Me too.Do you know why?

Was this page helpful?
0 / 5 - 0 ratings