Remove prettytable in requirements.txt (#29100)

musl/disable_test_yolov3_temporarily
Aurelius84 5 years ago committed by GitHub
parent b052149dcf
commit 14013a2eba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -34,7 +34,6 @@ Example:
Total FLOPs: 11692747751(11.69G)
'''
from collections import OrderedDict
from prettytable import PrettyTable
def summary(main_prog):
@ -149,6 +148,8 @@ def _format_summary(collected_ops_list):
summary_table: summary report format
total: sum param and flops
'''
_verify_dependent_package()
summary_table = PrettyTable(
["No.", "TYPE", "INPUT", "OUTPUT", "PARAMs", "FLOPs"])
summary_table.align = 'r'
@ -176,6 +177,18 @@ def _format_summary(collected_ops_list):
return summary_table, total
def _verify_dependent_package():
"""
Verify whether `prettytable` is installed.
"""
try:
from prettytable import PrettyTable
except ImportError:
raise ImportError(
"paddle.summary() requires package `prettytable`, place install it firstly using `pip install prettytable`. "
)
def _print_summary(summary_table, total):
'''
Print all the summary on terminal.

@ -11,6 +11,5 @@ rarfile
Pillow
six
decorator
prettytable
astor
pathlib

Loading…
Cancel
Save