Avoid Python 3.9 with_stem (#3589)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
Colin Wong
2023-07-07 17:16:42 -05:00
committed by GitHub
parent b8cc404ebf
commit 23c7cd4c9f
3 changed files with 2 additions and 3 deletions

View File

@ -591,7 +591,7 @@ class Exporter:
# Remove/rename TFLite models
if self.args.int8:
for file in f.rglob('*_dynamic_range_quant.tflite'):
file.rename(file.with_stem(file.stem.replace('_dynamic_range_quant', '_int8')))
file.rename(file.with_name(file.stem.replace('_dynamic_range_quant', '_int8') + file.suffix))
for file in f.rglob('*_integer_quant_with_int16_act.tflite'):
file.unlink() # delete extra fp16 activation TFLite files