I try to run run.py using mobilenet_thin model and not input --scales argument, but scales always show that it not defined, even though it has been default value. I try to input value like in the code [1.0, (1.1, 0.05)] as example, then show
scales = ast.literal_eval(scales)
error: unrecognized arguments: (1.1, 0.05)]
Can you explain why?
Thank you in advance
You can try change the codes to:
parser.add_argument('--scales', type=str, default='[1.0, (1.1, 0.05)]', help='for multiple scales, eg. [1.0, (1.1, 0.05)]')
args = parser.parse_args()
scales = ast.literal_eval(args.scales)
@khaerulumam42 What was your command? I guess the command script was invalid, so I want to know your exact command.
I'm still seeing this error with the latest version:
python3 src/run.py --model=mobilenet_thin_432x368 --image=images/p1.jpg
Traceback (most recent call last):
File "src/run.py", line 32, in <module>
scales = ast.literal_eval(scales)
NameError: name 'scales' is not defined
Any ideas?
A work around is to comment out this line in run.py:
# scales = ast.literal_eval(scales)
Thanks everyone, its solved using @cehanluo reply. The problem is because in the script use scales = ast.literal_eval(scales) instead scales = ast.literal_eval(args.scales). Because the scale got from args.
@cehanluo @khaerulumam42 can you please tell the line where we need to modify this
Most helpful comment
You can try change the codes to: