cdZWj 5 месяцев назад
Родитель
Сommit
36bf065632
1 измененных файлов с 21 добавлено и 7 удалено
  1. 21 7
      app_test.py

+ 21 - 7
app_test.py

@@ -1,14 +1,28 @@
 
 
-from PointerNet.config import rootdir
-print(rootdir)
+# from PointerNet.config import rootdir
+# print(rootdir)
 
 
-from PointerNet.main import NerPipeline
-from PointerNet.model import UIEModel
-from PointerNet import config
+# from PointerNet.main import NerPipeline
+# from PointerNet.model import UIEModel
+# from PointerNet import config
 
-nerArgs = config.NerArgs()
-print(dir(nerArgs))
+# nerArgs = config.NerArgs()
+# print(dir(nerArgs))
 # model = UIEModel(nerArgs)
 # ner_pipeline = NerPipeline(model, nerArgs)
+
+
+from memory_profiler import profile
+from PointerNet import config
+from PointerNet.predictor import Predictor
+from PointerNet.main import NerPipeline
+from PointerNet.model import UIEModel
+import gc
+
+@profile(precision=2)  # 会显示执行到每一行时所占的总内存
+def run_code():
+    nerArgs = config.NerArgs()
+    pred = Predictor(nerArgs)  # 725M
+run_code()